419 lines
13 KiB
Dart
419 lines
13 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 'models.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(4, 8789103914473960036),
|
|
name: 'ChatChannel',
|
|
lastPropertyId: const obx_int.IdUid(4, 1292940478834995143),
|
|
flags: 0,
|
|
properties: <obx_int.ModelProperty>[
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(1, 8326949064500635093),
|
|
name: 'id',
|
|
type: 6,
|
|
flags: 1,
|
|
),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(2, 4261805573466490477),
|
|
name: 'name',
|
|
type: 9,
|
|
flags: 2080,
|
|
indexId: const obx_int.IdUid(5, 7489629953476729908),
|
|
),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(3, 3159087232030070914),
|
|
name: 'description',
|
|
type: 9,
|
|
flags: 0,
|
|
),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(4, 1292940478834995143),
|
|
name: 'createdAt',
|
|
type: 10,
|
|
flags: 0,
|
|
),
|
|
],
|
|
relations: <obx_int.ModelRelation>[],
|
|
backlinks: <obx_int.ModelBacklink>[],
|
|
),
|
|
obx_int.ModelEntity(
|
|
id: const obx_int.IdUid(5, 3737221321740284134),
|
|
name: 'ChatMessage',
|
|
lastPropertyId: const obx_int.IdUid(5, 9202752608552942529),
|
|
flags: 0,
|
|
properties: <obx_int.ModelProperty>[
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(1, 6937877991903739354),
|
|
name: 'id',
|
|
type: 6,
|
|
flags: 1,
|
|
),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(2, 2320935452587221036),
|
|
name: 'content',
|
|
type: 9,
|
|
flags: 0,
|
|
),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(3, 4252783758825304742),
|
|
name: 'senderId',
|
|
type: 6,
|
|
flags: 8,
|
|
indexId: const obx_int.IdUid(6, 1080757755541990100),
|
|
),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(4, 3240604049002701987),
|
|
name: 'channelId',
|
|
type: 6,
|
|
flags: 8,
|
|
indexId: const obx_int.IdUid(7, 2720778762517392200),
|
|
),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(5, 9202752608552942529),
|
|
name: 'createdAt',
|
|
type: 10,
|
|
flags: 0,
|
|
),
|
|
],
|
|
relations: <obx_int.ModelRelation>[],
|
|
backlinks: <obx_int.ModelBacklink>[],
|
|
),
|
|
obx_int.ModelEntity(
|
|
id: const obx_int.IdUid(6, 6808595317639142314),
|
|
name: 'ChatUser',
|
|
lastPropertyId: const obx_int.IdUid(4, 3756250635467596289),
|
|
flags: 0,
|
|
properties: <obx_int.ModelProperty>[
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(1, 5564900411312083069),
|
|
name: 'id',
|
|
type: 6,
|
|
flags: 1,
|
|
),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(2, 3278062150453672411),
|
|
name: 'username',
|
|
type: 9,
|
|
flags: 2048,
|
|
indexId: const obx_int.IdUid(8, 3068871702763915304),
|
|
),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(3, 7002102783671264440),
|
|
name: 'passwordHash',
|
|
type: 9,
|
|
flags: 0,
|
|
),
|
|
obx_int.ModelProperty(
|
|
id: const obx_int.IdUid(4, 3756250635467596289),
|
|
name: 'createdAt',
|
|
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.
|
|
obx.Store openStore({
|
|
String? directory,
|
|
int? maxDBSizeInKB,
|
|
int? maxDataSizeInKB,
|
|
int? fileMode,
|
|
int? maxReaders,
|
|
bool queriesCaseSensitiveDefault = true,
|
|
String? macosApplicationGroup,
|
|
}) {
|
|
return obx.Store(
|
|
getObjectBoxModel(),
|
|
directory: directory,
|
|
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(
|
|
// If this version is not found, it means that this file was generated
|
|
// with an older version of the ObjectBox Dart generator.
|
|
// Please regenerate this file with the current generator version.
|
|
// Typically, this is done with `dart run build_runner build`.
|
|
generatorVersion: obx_int.GeneratorVersion.v2025_12_16,
|
|
entities: _entities,
|
|
lastEntityId: const obx_int.IdUid(6, 6808595317639142314),
|
|
lastIndexId: const obx_int.IdUid(8, 3068871702763915304),
|
|
lastRelationId: const obx_int.IdUid(0, 0),
|
|
lastSequenceId: const obx_int.IdUid(0, 0),
|
|
retiredEntityUids: const [
|
|
240536022189472816,
|
|
8077011728318081304,
|
|
4705468874025958717,
|
|
],
|
|
retiredIndexUids: const [],
|
|
retiredPropertyUids: const [
|
|
8544617182402792569,
|
|
6117431287454466914,
|
|
5437786674528658195,
|
|
6072852454810870218,
|
|
2542181165384894966,
|
|
864989412971989074,
|
|
8028710060941408150,
|
|
1587682278007620331,
|
|
4383284664306084614,
|
|
8714147817359246506,
|
|
7393508199779059949,
|
|
3791306853268708842,
|
|
6999720138118727677,
|
|
],
|
|
retiredRelationUids: const [],
|
|
modelVersion: 5,
|
|
modelVersionParserMinimum: 5,
|
|
version: 1,
|
|
);
|
|
|
|
final bindings = <Type, obx_int.EntityDefinition>{
|
|
ChatChannel: obx_int.EntityDefinition<ChatChannel>(
|
|
model: _entities[0],
|
|
toOneRelations: (ChatChannel object) => [],
|
|
toManyRelations: (ChatChannel object) => {},
|
|
getId: (ChatChannel object) => object.id,
|
|
setId: (ChatChannel object, int id) {
|
|
object.id = id;
|
|
},
|
|
objectToFB: (ChatChannel object, fb.Builder fbb) {
|
|
final nameOffset = fbb.writeString(object.name);
|
|
final descriptionOffset = object.description == null
|
|
? null
|
|
: fbb.writeString(object.description!);
|
|
fbb.startTable(5);
|
|
fbb.addInt64(0, object.id);
|
|
fbb.addOffset(1, nameOffset);
|
|
fbb.addOffset(2, descriptionOffset);
|
|
fbb.addInt64(3, object.createdAt.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 nameParam = const fb.StringReader(
|
|
asciiOptimization: true,
|
|
).vTableGet(buffer, rootOffset, 6, '');
|
|
final descriptionParam = const fb.StringReader(
|
|
asciiOptimization: true,
|
|
).vTableGetNullable(buffer, rootOffset, 8);
|
|
final createdAtParam = DateTime.fromMillisecondsSinceEpoch(
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0),
|
|
);
|
|
final object = ChatChannel(
|
|
name: nameParam,
|
|
description: descriptionParam,
|
|
createdAt: createdAtParam,
|
|
)..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0);
|
|
|
|
return object;
|
|
},
|
|
),
|
|
ChatMessage: obx_int.EntityDefinition<ChatMessage>(
|
|
model: _entities[1],
|
|
toOneRelations: (ChatMessage object) => [],
|
|
toManyRelations: (ChatMessage object) => {},
|
|
getId: (ChatMessage object) => object.id,
|
|
setId: (ChatMessage object, int id) {
|
|
object.id = id;
|
|
},
|
|
objectToFB: (ChatMessage object, fb.Builder fbb) {
|
|
final contentOffset = fbb.writeString(object.content);
|
|
fbb.startTable(6);
|
|
fbb.addInt64(0, object.id);
|
|
fbb.addOffset(1, contentOffset);
|
|
fbb.addInt64(2, object.senderId);
|
|
fbb.addInt64(3, object.channelId);
|
|
fbb.addInt64(4, object.createdAt.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 contentParam = const fb.StringReader(
|
|
asciiOptimization: true,
|
|
).vTableGet(buffer, rootOffset, 6, '');
|
|
final senderIdParam = const fb.Int64Reader().vTableGet(
|
|
buffer,
|
|
rootOffset,
|
|
8,
|
|
0,
|
|
);
|
|
final channelIdParam = const fb.Int64Reader().vTableGet(
|
|
buffer,
|
|
rootOffset,
|
|
10,
|
|
0,
|
|
);
|
|
final createdAtParam = DateTime.fromMillisecondsSinceEpoch(
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 12, 0),
|
|
);
|
|
final object = ChatMessage(
|
|
content: contentParam,
|
|
senderId: senderIdParam,
|
|
channelId: channelIdParam,
|
|
createdAt: createdAtParam,
|
|
)..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0);
|
|
|
|
return object;
|
|
},
|
|
),
|
|
ChatUser: obx_int.EntityDefinition<ChatUser>(
|
|
model: _entities[2],
|
|
toOneRelations: (ChatUser object) => [],
|
|
toManyRelations: (ChatUser object) => {},
|
|
getId: (ChatUser object) => object.id,
|
|
setId: (ChatUser object, int id) {
|
|
object.id = id;
|
|
},
|
|
objectToFB: (ChatUser object, fb.Builder fbb) {
|
|
final usernameOffset = fbb.writeString(object.username);
|
|
final passwordHashOffset = fbb.writeString(object.passwordHash);
|
|
fbb.startTable(5);
|
|
fbb.addInt64(0, object.id);
|
|
fbb.addOffset(1, usernameOffset);
|
|
fbb.addOffset(2, passwordHashOffset);
|
|
fbb.addInt64(3, object.createdAt.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 usernameParam = const fb.StringReader(
|
|
asciiOptimization: true,
|
|
).vTableGet(buffer, rootOffset, 6, '');
|
|
final passwordHashParam = const fb.StringReader(
|
|
asciiOptimization: true,
|
|
).vTableGet(buffer, rootOffset, 8, '');
|
|
final createdAtParam = DateTime.fromMillisecondsSinceEpoch(
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0),
|
|
);
|
|
final object = ChatUser(
|
|
username: usernameParam,
|
|
passwordHash: passwordHashParam,
|
|
createdAt: createdAtParam,
|
|
)..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0);
|
|
|
|
return object;
|
|
},
|
|
),
|
|
};
|
|
|
|
return obx_int.ModelDefinition(model, bindings);
|
|
}
|
|
|
|
/// [ChatChannel] entity fields to define ObjectBox queries.
|
|
class ChatChannel_ {
|
|
/// See [ChatChannel.id].
|
|
static final id = obx.QueryIntegerProperty<ChatChannel>(
|
|
_entities[0].properties[0],
|
|
);
|
|
|
|
/// See [ChatChannel.name].
|
|
static final name = obx.QueryStringProperty<ChatChannel>(
|
|
_entities[0].properties[1],
|
|
);
|
|
|
|
/// See [ChatChannel.description].
|
|
static final description = obx.QueryStringProperty<ChatChannel>(
|
|
_entities[0].properties[2],
|
|
);
|
|
|
|
/// See [ChatChannel.createdAt].
|
|
static final createdAt = obx.QueryDateProperty<ChatChannel>(
|
|
_entities[0].properties[3],
|
|
);
|
|
}
|
|
|
|
/// [ChatMessage] entity fields to define ObjectBox queries.
|
|
class ChatMessage_ {
|
|
/// See [ChatMessage.id].
|
|
static final id = obx.QueryIntegerProperty<ChatMessage>(
|
|
_entities[1].properties[0],
|
|
);
|
|
|
|
/// See [ChatMessage.content].
|
|
static final content = obx.QueryStringProperty<ChatMessage>(
|
|
_entities[1].properties[1],
|
|
);
|
|
|
|
/// See [ChatMessage.senderId].
|
|
static final senderId = obx.QueryIntegerProperty<ChatMessage>(
|
|
_entities[1].properties[2],
|
|
);
|
|
|
|
/// See [ChatMessage.channelId].
|
|
static final channelId = obx.QueryIntegerProperty<ChatMessage>(
|
|
_entities[1].properties[3],
|
|
);
|
|
|
|
/// See [ChatMessage.createdAt].
|
|
static final createdAt = obx.QueryDateProperty<ChatMessage>(
|
|
_entities[1].properties[4],
|
|
);
|
|
}
|
|
|
|
/// [ChatUser] entity fields to define ObjectBox queries.
|
|
class ChatUser_ {
|
|
/// See [ChatUser.id].
|
|
static final id = obx.QueryIntegerProperty<ChatUser>(
|
|
_entities[2].properties[0],
|
|
);
|
|
|
|
/// See [ChatUser.username].
|
|
static final username = obx.QueryStringProperty<ChatUser>(
|
|
_entities[2].properties[1],
|
|
);
|
|
|
|
/// See [ChatUser.passwordHash].
|
|
static final passwordHash = obx.QueryStringProperty<ChatUser>(
|
|
_entities[2].properties[2],
|
|
);
|
|
|
|
/// See [ChatUser.createdAt].
|
|
static final createdAt = obx.QueryDateProperty<ChatUser>(
|
|
_entities[2].properties[3],
|
|
);
|
|
}
|