kopia lustrzana https://gitlab.com/mysocialportal/relatica
384 wiersze
14 KiB
Dart
384 wiersze
14 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// This code was generated by ObjectBox. To update it run the generator again
|
|
// with `dart run build_runner build`.
|
|
// See also https://docs.objectbox.io/getting-started#generate-objectbox-code
|
|
|
|
// ignore_for_file: camel_case_types, depend_on_referenced_packages
|
|
// coverage:ignore-file
|
|
|
|
import 'dart:typed_data';
|
|
|
|
import 'package:flat_buffers/flat_buffers.dart' as fb;
|
|
import 'package:objectbox/internal.dart'
|
|
as obx_int; // generated code can access "internal" functionality
|
|
import 'package:objectbox/objectbox.dart' as obx;
|
|
import 'package:objectbox_flutter_libs/objectbox_flutter_libs.dart';
|
|
|
|
import 'models/connection.dart';
|
|
import 'models/hashtag.dart';
|
|
|
|
export 'package:objectbox/objectbox.dart'; // so that callers only have to import this file
|
|
|
|
final _entities = <obx_int.ModelEntity>[
|
|
obx_int.ModelEntity(
|
|
id: const obx_int.IdUid(1, 1213035855270739890),
|
|
name: 'Connection',
|
|
lastPropertyId: const obx_int.IdUid(14, 7495390888349913259),
|
|
flags: 0,
|
|
properties: <obx_int.ModelProperty>[
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(1, 4133343279264917280),
|
|
name: 'obId',
|
|
type: 6,
|
|
flags: 1),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(2, 3393770296096844708),
|
|
name: 'name',
|
|
type: 9,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(3, 5864801995210079539),
|
|
name: 'handle',
|
|
type: 9,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(4, 2926904168461994523),
|
|
name: 'id',
|
|
type: 9,
|
|
flags: 34848,
|
|
indexId: const obx_int.IdUid(1, 8342366639839511243)),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(5, 3621370552742492695),
|
|
name: 'network',
|
|
type: 9,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(6, 3054748457893853359),
|
|
name: 'profileUrl',
|
|
type: 9,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(7, 3716471511430220806),
|
|
name: 'avatarUrl',
|
|
type: 9,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(8, 3334077197732145885),
|
|
name: 'dbStatus',
|
|
type: 6,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(9, 7727190023732579468),
|
|
name: 'lastUpdateTime',
|
|
type: 10,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(10, 7236128628019094924),
|
|
name: 'note',
|
|
type: 9,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(11, 714760695336940281),
|
|
name: 'followerCount',
|
|
type: 6,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(12, 4204087390924684186),
|
|
name: 'followingCount',
|
|
type: 6,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(13, 6842754750534163483),
|
|
name: 'statusesCount',
|
|
type: 6,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(14, 7495390888349913259),
|
|
name: 'lastStatus',
|
|
type: 10,
|
|
flags: 0)
|
|
],
|
|
relations: <obx_int.ModelRelation>[],
|
|
backlinks: <obx_int.ModelBacklink>[]),
|
|
obx_int.ModelEntity(
|
|
id: const obx_int.IdUid(2, 8060242331335522964),
|
|
name: 'Hashtag',
|
|
lastPropertyId: const obx_int.IdUid(4, 985152873657204249),
|
|
flags: 0,
|
|
properties: <obx_int.ModelProperty>[
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(1, 3633001791521338712),
|
|
name: 'id',
|
|
type: 6,
|
|
flags: 1),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(2, 3468373950035339457),
|
|
name: 'tag',
|
|
type: 9,
|
|
flags: 34848,
|
|
indexId: const obx_int.IdUid(2, 6156017341759176249)),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(3, 5102584273729210526),
|
|
name: 'url',
|
|
type: 9,
|
|
flags: 0),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(4, 985152873657204249),
|
|
name: 'lastUpdateTime',
|
|
type: 10,
|
|
flags: 0)
|
|
],
|
|
relations: <obx_int.ModelRelation>[],
|
|
backlinks: <obx_int.ModelBacklink>[])
|
|
];
|
|
|
|
/// Shortcut for [obx.Store.new] that passes [getObjectBoxModel] and for Flutter
|
|
/// apps by default a [directory] using `defaultStoreDirectory()` from the
|
|
/// ObjectBox Flutter library.
|
|
///
|
|
/// Note: for desktop apps it is recommended to specify a unique [directory].
|
|
///
|
|
/// See [obx.Store.new] for an explanation of all parameters.
|
|
///
|
|
/// For Flutter apps, also calls `loadObjectBoxLibraryAndroidCompat()` from
|
|
/// the ObjectBox Flutter library to fix loading the native ObjectBox library
|
|
/// on Android 6 and older.
|
|
Future<obx.Store> openStore(
|
|
{String? directory,
|
|
int? maxDBSizeInKB,
|
|
int? maxDataSizeInKB,
|
|
int? fileMode,
|
|
int? maxReaders,
|
|
bool queriesCaseSensitiveDefault = true,
|
|
String? macosApplicationGroup}) async {
|
|
await loadObjectBoxLibraryAndroidCompat();
|
|
return obx.Store(getObjectBoxModel(),
|
|
directory: directory ?? (await defaultStoreDirectory()).path,
|
|
maxDBSizeInKB: maxDBSizeInKB,
|
|
maxDataSizeInKB: maxDataSizeInKB,
|
|
fileMode: fileMode,
|
|
maxReaders: maxReaders,
|
|
queriesCaseSensitiveDefault: queriesCaseSensitiveDefault,
|
|
macosApplicationGroup: macosApplicationGroup);
|
|
}
|
|
|
|
/// Returns the ObjectBox model definition for this project for use with
|
|
/// [obx.Store.new].
|
|
obx_int.ModelDefinition getObjectBoxModel() {
|
|
final model = obx_int.ModelInfo(
|
|
entities: _entities,
|
|
lastEntityId: const obx_int.IdUid(2, 8060242331335522964),
|
|
lastIndexId: const obx_int.IdUid(2, 6156017341759176249),
|
|
lastRelationId: const obx_int.IdUid(0, 0),
|
|
lastSequenceId: const obx_int.IdUid(0, 0),
|
|
retiredEntityUids: const [],
|
|
retiredIndexUids: const [],
|
|
retiredPropertyUids: const [],
|
|
retiredRelationUids: const [],
|
|
modelVersion: 5,
|
|
modelVersionParserMinimum: 5,
|
|
version: 1);
|
|
|
|
final bindings = <Type, obx_int.EntityDefinition>{
|
|
Connection: obx_int.EntityDefinition<Connection>(
|
|
model: _entities[0],
|
|
toOneRelations: (Connection object) => [],
|
|
toManyRelations: (Connection object) => {},
|
|
getId: (Connection object) => object.obId,
|
|
setId: (Connection object, int id) {
|
|
object.obId = id;
|
|
},
|
|
objectToFB: (Connection object, fb.Builder fbb) {
|
|
final nameOffset = fbb.writeString(object.name);
|
|
final handleOffset = fbb.writeString(object.handle);
|
|
final idOffset = fbb.writeString(object.id);
|
|
final networkOffset = fbb.writeString(object.network);
|
|
final profileUrlOffset = fbb.writeString(object.profileUrl);
|
|
final avatarUrlOffset = fbb.writeString(object.avatarUrl);
|
|
final noteOffset = fbb.writeString(object.note);
|
|
fbb.startTable(15);
|
|
fbb.addInt64(0, object.obId);
|
|
fbb.addOffset(1, nameOffset);
|
|
fbb.addOffset(2, handleOffset);
|
|
fbb.addOffset(3, idOffset);
|
|
fbb.addOffset(4, networkOffset);
|
|
fbb.addOffset(5, profileUrlOffset);
|
|
fbb.addOffset(6, avatarUrlOffset);
|
|
fbb.addInt64(7, object.dbStatus);
|
|
fbb.addInt64(8, object.lastUpdateTime.millisecondsSinceEpoch);
|
|
fbb.addOffset(9, noteOffset);
|
|
fbb.addInt64(10, object.followerCount);
|
|
fbb.addInt64(11, object.followingCount);
|
|
fbb.addInt64(12, object.statusesCount);
|
|
fbb.addInt64(13, object.lastStatus?.millisecondsSinceEpoch);
|
|
fbb.finish(fbb.endTable());
|
|
return object.obId;
|
|
},
|
|
objectFromFB: (obx.Store store, ByteData fbData) {
|
|
final buffer = fb.BufferContext(fbData);
|
|
final rootOffset = buffer.derefObject(0);
|
|
final lastStatusValue =
|
|
const fb.Int64Reader().vTableGetNullable(buffer, rootOffset, 30);
|
|
final obIdParam =
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0);
|
|
final nameParam = const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 6, '');
|
|
final handleParam = const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 8, '');
|
|
final idParam = const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 10, '');
|
|
final profileUrlParam = const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 14, '');
|
|
final networkParam = const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 12, '');
|
|
final avatarUrlParam = const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 16, '');
|
|
final lastUpdateTimeParam = DateTime.fromMillisecondsSinceEpoch(
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 20, 0));
|
|
final noteParam = const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 22, '');
|
|
final followerCountParam =
|
|
const fb.Int64Reader().vTableGetNullable(buffer, rootOffset, 24);
|
|
final followingCountParam =
|
|
const fb.Int64Reader().vTableGetNullable(buffer, rootOffset, 26);
|
|
final statusesCountParam =
|
|
const fb.Int64Reader().vTableGetNullable(buffer, rootOffset, 28);
|
|
final lastStatusParam = lastStatusValue == null
|
|
? null
|
|
: DateTime.fromMillisecondsSinceEpoch(lastStatusValue);
|
|
final object = Connection(
|
|
obId: obIdParam,
|
|
name: nameParam,
|
|
handle: handleParam,
|
|
id: idParam,
|
|
profileUrl: profileUrlParam,
|
|
network: networkParam,
|
|
avatarUrl: avatarUrlParam,
|
|
lastUpdateTime: lastUpdateTimeParam,
|
|
note: noteParam,
|
|
followerCount: followerCountParam,
|
|
followingCount: followingCountParam,
|
|
statusesCount: statusesCountParam,
|
|
lastStatus: lastStatusParam)
|
|
..dbStatus =
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 18, 0);
|
|
|
|
return object;
|
|
}),
|
|
Hashtag: obx_int.EntityDefinition<Hashtag>(
|
|
model: _entities[1],
|
|
toOneRelations: (Hashtag object) => [],
|
|
toManyRelations: (Hashtag object) => {},
|
|
getId: (Hashtag object) => object.id,
|
|
setId: (Hashtag object, int id) {
|
|
object.id = id;
|
|
},
|
|
objectToFB: (Hashtag object, fb.Builder fbb) {
|
|
final tagOffset = fbb.writeString(object.tag);
|
|
final urlOffset = fbb.writeString(object.url);
|
|
fbb.startTable(5);
|
|
fbb.addInt64(0, object.id);
|
|
fbb.addOffset(1, tagOffset);
|
|
fbb.addOffset(2, urlOffset);
|
|
fbb.addInt64(3, object.lastUpdateTime.millisecondsSinceEpoch);
|
|
fbb.finish(fbb.endTable());
|
|
return object.id;
|
|
},
|
|
objectFromFB: (obx.Store store, ByteData fbData) {
|
|
final buffer = fb.BufferContext(fbData);
|
|
final rootOffset = buffer.derefObject(0);
|
|
final idParam =
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0);
|
|
final tagParam = const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 6, '');
|
|
final urlParam = const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 8, '');
|
|
final object = Hashtag(id: idParam, tag: tagParam, url: urlParam)
|
|
..lastUpdateTime = DateTime.fromMillisecondsSinceEpoch(
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0));
|
|
|
|
return object;
|
|
})
|
|
};
|
|
|
|
return obx_int.ModelDefinition(model, bindings);
|
|
}
|
|
|
|
/// [Connection] entity fields to define ObjectBox queries.
|
|
class Connection_ {
|
|
/// See [Connection.obId].
|
|
static final obId =
|
|
obx.QueryIntegerProperty<Connection>(_entities[0].properties[0]);
|
|
|
|
/// See [Connection.name].
|
|
static final name =
|
|
obx.QueryStringProperty<Connection>(_entities[0].properties[1]);
|
|
|
|
/// See [Connection.handle].
|
|
static final handle =
|
|
obx.QueryStringProperty<Connection>(_entities[0].properties[2]);
|
|
|
|
/// See [Connection.id].
|
|
static final id =
|
|
obx.QueryStringProperty<Connection>(_entities[0].properties[3]);
|
|
|
|
/// See [Connection.network].
|
|
static final network =
|
|
obx.QueryStringProperty<Connection>(_entities[0].properties[4]);
|
|
|
|
/// See [Connection.profileUrl].
|
|
static final profileUrl =
|
|
obx.QueryStringProperty<Connection>(_entities[0].properties[5]);
|
|
|
|
/// See [Connection.avatarUrl].
|
|
static final avatarUrl =
|
|
obx.QueryStringProperty<Connection>(_entities[0].properties[6]);
|
|
|
|
/// See [Connection.dbStatus].
|
|
static final dbStatus =
|
|
obx.QueryIntegerProperty<Connection>(_entities[0].properties[7]);
|
|
|
|
/// See [Connection.lastUpdateTime].
|
|
static final lastUpdateTime =
|
|
obx.QueryDateProperty<Connection>(_entities[0].properties[8]);
|
|
|
|
/// See [Connection.note].
|
|
static final note =
|
|
obx.QueryStringProperty<Connection>(_entities[0].properties[9]);
|
|
|
|
/// See [Connection.followerCount].
|
|
static final followerCount =
|
|
obx.QueryIntegerProperty<Connection>(_entities[0].properties[10]);
|
|
|
|
/// See [Connection.followingCount].
|
|
static final followingCount =
|
|
obx.QueryIntegerProperty<Connection>(_entities[0].properties[11]);
|
|
|
|
/// See [Connection.statusesCount].
|
|
static final statusesCount =
|
|
obx.QueryIntegerProperty<Connection>(_entities[0].properties[12]);
|
|
|
|
/// See [Connection.lastStatus].
|
|
static final lastStatus =
|
|
obx.QueryDateProperty<Connection>(_entities[0].properties[13]);
|
|
}
|
|
|
|
/// [Hashtag] entity fields to define ObjectBox queries.
|
|
class Hashtag_ {
|
|
/// See [Hashtag.id].
|
|
static final id =
|
|
obx.QueryIntegerProperty<Hashtag>(_entities[1].properties[0]);
|
|
|
|
/// See [Hashtag.tag].
|
|
static final tag =
|
|
obx.QueryStringProperty<Hashtag>(_entities[1].properties[1]);
|
|
|
|
/// See [Hashtag.url].
|
|
static final url =
|
|
obx.QueryStringProperty<Hashtag>(_entities[1].properties[2]);
|
|
|
|
/// See [Hashtag.lastUpdateTime].
|
|
static final lastUpdateTime =
|
|
obx.QueryDateProperty<Hashtag>(_entities[1].properties[3]);
|
|
}
|