491 lines
17 KiB
Dart
491 lines
17 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// This code was generated by ObjectBox. To update it run the generator again:
|
|
// With a Flutter package, run `flutter pub run build_runner build`.
|
|
// With a Dart package, run `dart run build_runner build`.
|
|
// See also https://docs.objectbox.io/getting-started#generate-objectbox-code
|
|
|
|
// ignore_for_file: camel_case_types
|
|
// coverage:ignore-file
|
|
|
|
import 'dart:typed_data';
|
|
|
|
import 'package:flat_buffers/flat_buffers.dart' as fb;
|
|
import 'package:objectbox/internal.dart'; // generated code can access "internal" functionality
|
|
import 'package:objectbox/objectbox.dart';
|
|
import 'package:objectbox_flutter_libs/objectbox_flutter_libs.dart';
|
|
|
|
import 'db/box_etab.dart';
|
|
import 'db/box_log.dart';
|
|
import 'db/box_user.dart';
|
|
import 'model.dart';
|
|
|
|
export 'package:objectbox/objectbox.dart'; // so that callers only have to import this file
|
|
|
|
final _entities = <ModelEntity>[
|
|
ModelEntity(
|
|
id: const IdUid(1, 2802681814019499133),
|
|
name: 'Note',
|
|
lastPropertyId: const IdUid(4, 6451339597165131221),
|
|
flags: 0,
|
|
properties: <ModelProperty>[
|
|
ModelProperty(
|
|
id: const IdUid(1, 3178873177797362769),
|
|
name: 'id',
|
|
type: 6,
|
|
flags: 1),
|
|
ModelProperty(
|
|
id: const IdUid(2, 4285343053028527696),
|
|
name: 'text',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(3, 2606273611209948020),
|
|
name: 'comment',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(4, 6451339597165131221),
|
|
name: 'date',
|
|
type: 10,
|
|
flags: 0)
|
|
],
|
|
relations: <ModelRelation>[],
|
|
backlinks: <ModelBacklink>[]),
|
|
ModelEntity(
|
|
id: const IdUid(3, 6664528022814238868),
|
|
name: 'User',
|
|
lastPropertyId: const IdUid(6, 1514784951041121129),
|
|
flags: 0,
|
|
properties: <ModelProperty>[
|
|
ModelProperty(
|
|
id: const IdUid(1, 4611296599843691135),
|
|
name: 'id',
|
|
type: 6,
|
|
flags: 1),
|
|
ModelProperty(
|
|
id: const IdUid(2, 3082719507680383784),
|
|
name: 'photo',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(3, 6869254152255514608),
|
|
name: 'login',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(4, 3830288742147875657),
|
|
name: 'nom',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(5, 1856556503877986423),
|
|
name: 'prenom',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(6, 1514784951041121129),
|
|
name: 'id_utilisateur',
|
|
type: 6,
|
|
flags: 0)
|
|
],
|
|
relations: <ModelRelation>[],
|
|
backlinks: <ModelBacklink>[]),
|
|
ModelEntity(
|
|
id: const IdUid(4, 4389962693874538546),
|
|
name: 'Log',
|
|
lastPropertyId: const IdUid(7, 4949059821139557407),
|
|
flags: 0,
|
|
properties: <ModelProperty>[
|
|
ModelProperty(
|
|
id: const IdUid(1, 3034881956612204559),
|
|
name: 'id',
|
|
type: 6,
|
|
flags: 1),
|
|
ModelProperty(
|
|
id: const IdUid(2, 1575574682059681804),
|
|
name: 'type',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(3, 8168339759075122864),
|
|
name: 'date',
|
|
type: 10,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(4, 1699927074197883718),
|
|
name: 'module',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(5, 7184817111174936621),
|
|
name: 'libelle',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(6, 6213554048326311571),
|
|
name: 'duree',
|
|
type: 6,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(7, 4949059821139557407),
|
|
name: 'uploaded',
|
|
type: 6,
|
|
flags: 0)
|
|
],
|
|
relations: <ModelRelation>[],
|
|
backlinks: <ModelBacklink>[]),
|
|
ModelEntity(
|
|
id: const IdUid(5, 6220645616537106928),
|
|
name: 'Etab',
|
|
lastPropertyId: const IdUid(9, 4862523104151141465),
|
|
flags: 0,
|
|
properties: <ModelProperty>[
|
|
ModelProperty(
|
|
id: const IdUid(1, 2951125380051176697),
|
|
name: 'id',
|
|
type: 6,
|
|
flags: 1),
|
|
ModelProperty(
|
|
id: const IdUid(2, 986806885009634082),
|
|
name: 'id_etab',
|
|
type: 6,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(3, 2138930560668315243),
|
|
name: 'nom',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(4, 6458474884283325627),
|
|
name: 'mail',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(5, 8380062137599693463),
|
|
name: 'tel',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(7, 5547045221255607235),
|
|
name: 'longitude',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(8, 5768827910047585940),
|
|
name: 'latitude',
|
|
type: 9,
|
|
flags: 0),
|
|
ModelProperty(
|
|
id: const IdUid(9, 4862523104151141465),
|
|
name: 'url_photo_principale',
|
|
type: 9,
|
|
flags: 0)
|
|
],
|
|
relations: <ModelRelation>[],
|
|
backlinks: <ModelBacklink>[])
|
|
];
|
|
|
|
/// Open an ObjectBox store with the model declared in this file.
|
|
Future<Store> openStore(
|
|
{String? directory,
|
|
int? maxDBSizeInKB,
|
|
int? fileMode,
|
|
int? maxReaders,
|
|
bool queriesCaseSensitiveDefault = true,
|
|
String? macosApplicationGroup}) async =>
|
|
Store(getObjectBoxModel(),
|
|
directory: directory ?? (await defaultStoreDirectory()).path,
|
|
maxDBSizeInKB: maxDBSizeInKB,
|
|
fileMode: fileMode,
|
|
maxReaders: maxReaders,
|
|
queriesCaseSensitiveDefault: queriesCaseSensitiveDefault,
|
|
macosApplicationGroup: macosApplicationGroup);
|
|
|
|
/// ObjectBox model definition, pass it to [Store] - Store(getObjectBoxModel())
|
|
ModelDefinition getObjectBoxModel() {
|
|
final model = ModelInfo(
|
|
entities: _entities,
|
|
lastEntityId: const IdUid(5, 6220645616537106928),
|
|
lastIndexId: const IdUid(0, 0),
|
|
lastRelationId: const IdUid(0, 0),
|
|
lastSequenceId: const IdUid(0, 0),
|
|
retiredEntityUids: const [7401686910042688313],
|
|
retiredIndexUids: const [],
|
|
retiredPropertyUids: const [
|
|
402019719780433349,
|
|
2876428622751679696,
|
|
6435857490868115471
|
|
],
|
|
retiredRelationUids: const [],
|
|
modelVersion: 5,
|
|
modelVersionParserMinimum: 5,
|
|
version: 1);
|
|
|
|
final bindings = <Type, EntityDefinition>{
|
|
Note: EntityDefinition<Note>(
|
|
model: _entities[0],
|
|
toOneRelations: (Note object) => [],
|
|
toManyRelations: (Note object) => {},
|
|
getId: (Note object) => object.id,
|
|
setId: (Note object, int id) {
|
|
object.id = id;
|
|
},
|
|
objectToFB: (Note object, fb.Builder fbb) {
|
|
final textOffset = fbb.writeString(object.text);
|
|
final commentOffset =
|
|
object.comment == null ? null : fbb.writeString(object.comment!);
|
|
fbb.startTable(5);
|
|
fbb.addInt64(0, object.id);
|
|
fbb.addOffset(1, textOffset);
|
|
fbb.addOffset(2, commentOffset);
|
|
fbb.addInt64(3, object.date.millisecondsSinceEpoch);
|
|
fbb.finish(fbb.endTable());
|
|
return object.id;
|
|
},
|
|
objectFromFB: (Store store, ByteData fbData) {
|
|
final buffer = fb.BufferContext(fbData);
|
|
final rootOffset = buffer.derefObject(0);
|
|
|
|
final object = Note(
|
|
const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 6, ''),
|
|
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
|
comment: const fb.StringReader(asciiOptimization: true)
|
|
.vTableGetNullable(buffer, rootOffset, 8),
|
|
date: DateTime.fromMillisecondsSinceEpoch(
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0)));
|
|
|
|
return object;
|
|
}),
|
|
User: EntityDefinition<User>(
|
|
model: _entities[1],
|
|
toOneRelations: (User object) => [],
|
|
toManyRelations: (User object) => {},
|
|
getId: (User object) => object.id,
|
|
setId: (User object, int id) {
|
|
object.id = id;
|
|
},
|
|
objectToFB: (User object, fb.Builder fbb) {
|
|
final photoOffset = fbb.writeString(object.photo);
|
|
final loginOffset = fbb.writeString(object.login);
|
|
final nomOffset = fbb.writeString(object.nom);
|
|
final prenomOffset = fbb.writeString(object.prenom);
|
|
fbb.startTable(7);
|
|
fbb.addInt64(0, object.id);
|
|
fbb.addOffset(1, photoOffset);
|
|
fbb.addOffset(2, loginOffset);
|
|
fbb.addOffset(3, nomOffset);
|
|
fbb.addOffset(4, prenomOffset);
|
|
fbb.addInt64(5, object.id_utilisateur);
|
|
fbb.finish(fbb.endTable());
|
|
return object.id;
|
|
},
|
|
objectFromFB: (Store store, ByteData fbData) {
|
|
final buffer = fb.BufferContext(fbData);
|
|
final rootOffset = buffer.derefObject(0);
|
|
|
|
final object = User(
|
|
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
|
id_utilisateur:
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 14, 0),
|
|
login: const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 8, ''),
|
|
nom: const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 10, ''),
|
|
prenom: const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 12, ''),
|
|
photo: const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 6, ''));
|
|
|
|
return object;
|
|
}),
|
|
Log: EntityDefinition<Log>(
|
|
model: _entities[2],
|
|
toOneRelations: (Log object) => [],
|
|
toManyRelations: (Log object) => {},
|
|
getId: (Log object) => object.id,
|
|
setId: (Log object, int id) {
|
|
object.id = id;
|
|
},
|
|
objectToFB: (Log object, fb.Builder fbb) {
|
|
final typeOffset = fbb.writeString(object.type);
|
|
final moduleOffset = fbb.writeString(object.module);
|
|
final libelleOffset = fbb.writeString(object.libelle);
|
|
fbb.startTable(8);
|
|
fbb.addInt64(0, object.id);
|
|
fbb.addOffset(1, typeOffset);
|
|
fbb.addInt64(2, object.date.millisecondsSinceEpoch);
|
|
fbb.addOffset(3, moduleOffset);
|
|
fbb.addOffset(4, libelleOffset);
|
|
fbb.addInt64(5, object.duree);
|
|
fbb.addInt64(6, object.uploaded);
|
|
fbb.finish(fbb.endTable());
|
|
return object.id;
|
|
},
|
|
objectFromFB: (Store store, ByteData fbData) {
|
|
final buffer = fb.BufferContext(fbData);
|
|
final rootOffset = buffer.derefObject(0);
|
|
|
|
final object = Log(
|
|
const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 6, ''),
|
|
const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 10, ''),
|
|
const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 12, ''),
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 14, 0),
|
|
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
|
date: DateTime.fromMillisecondsSinceEpoch(
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0)),
|
|
uploaded:
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 16, 0));
|
|
|
|
return object;
|
|
}),
|
|
Etab: EntityDefinition<Etab>(
|
|
model: _entities[3],
|
|
toOneRelations: (Etab object) => [],
|
|
toManyRelations: (Etab object) => {},
|
|
getId: (Etab object) => object.id,
|
|
setId: (Etab object, int id) {
|
|
object.id = id;
|
|
},
|
|
objectToFB: (Etab object, fb.Builder fbb) {
|
|
final nomOffset = fbb.writeString(object.nom);
|
|
final mailOffset = fbb.writeString(object.mail);
|
|
final telOffset = fbb.writeString(object.tel);
|
|
final longitudeOffset = fbb.writeString(object.longitude);
|
|
final latitudeOffset = fbb.writeString(object.latitude);
|
|
final url_photo_principaleOffset =
|
|
fbb.writeString(object.url_photo_principale);
|
|
fbb.startTable(10);
|
|
fbb.addInt64(0, object.id);
|
|
fbb.addInt64(1, object.id_etab);
|
|
fbb.addOffset(2, nomOffset);
|
|
fbb.addOffset(3, mailOffset);
|
|
fbb.addOffset(4, telOffset);
|
|
fbb.addOffset(6, longitudeOffset);
|
|
fbb.addOffset(7, latitudeOffset);
|
|
fbb.addOffset(8, url_photo_principaleOffset);
|
|
fbb.finish(fbb.endTable());
|
|
return object.id;
|
|
},
|
|
objectFromFB: (Store store, ByteData fbData) {
|
|
final buffer = fb.BufferContext(fbData);
|
|
final rootOffset = buffer.derefObject(0);
|
|
|
|
final object = Etab(
|
|
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
|
id_etab:
|
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0),
|
|
nom: const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 8, ''),
|
|
mail: const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 10, ''),
|
|
tel: const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 12, ''),
|
|
url_photo_principale:
|
|
const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 20, ''),
|
|
longitude: const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 16, ''),
|
|
latitude: const fb.StringReader(asciiOptimization: true)
|
|
.vTableGet(buffer, rootOffset, 18, ''));
|
|
|
|
return object;
|
|
})
|
|
};
|
|
|
|
return ModelDefinition(model, bindings);
|
|
}
|
|
|
|
/// [Note] entity fields to define ObjectBox queries.
|
|
class Note_ {
|
|
/// see [Note.id]
|
|
static final id = QueryIntegerProperty<Note>(_entities[0].properties[0]);
|
|
|
|
/// see [Note.text]
|
|
static final text = QueryStringProperty<Note>(_entities[0].properties[1]);
|
|
|
|
/// see [Note.comment]
|
|
static final comment = QueryStringProperty<Note>(_entities[0].properties[2]);
|
|
|
|
/// see [Note.date]
|
|
static final date = QueryIntegerProperty<Note>(_entities[0].properties[3]);
|
|
}
|
|
|
|
/// [User] entity fields to define ObjectBox queries.
|
|
class User_ {
|
|
/// see [User.id]
|
|
static final id = QueryIntegerProperty<User>(_entities[1].properties[0]);
|
|
|
|
/// see [User.photo]
|
|
static final photo = QueryStringProperty<User>(_entities[1].properties[1]);
|
|
|
|
/// see [User.login]
|
|
static final login = QueryStringProperty<User>(_entities[1].properties[2]);
|
|
|
|
/// see [User.nom]
|
|
static final nom = QueryStringProperty<User>(_entities[1].properties[3]);
|
|
|
|
/// see [User.prenom]
|
|
static final prenom = QueryStringProperty<User>(_entities[1].properties[4]);
|
|
|
|
/// see [User.id_utilisateur]
|
|
static final id_utilisateur =
|
|
QueryIntegerProperty<User>(_entities[1].properties[5]);
|
|
}
|
|
|
|
/// [Log] entity fields to define ObjectBox queries.
|
|
class Log_ {
|
|
/// see [Log.id]
|
|
static final id = QueryIntegerProperty<Log>(_entities[2].properties[0]);
|
|
|
|
/// see [Log.type]
|
|
static final type = QueryStringProperty<Log>(_entities[2].properties[1]);
|
|
|
|
/// see [Log.date]
|
|
static final date = QueryIntegerProperty<Log>(_entities[2].properties[2]);
|
|
|
|
/// see [Log.module]
|
|
static final module = QueryStringProperty<Log>(_entities[2].properties[3]);
|
|
|
|
/// see [Log.libelle]
|
|
static final libelle = QueryStringProperty<Log>(_entities[2].properties[4]);
|
|
|
|
/// see [Log.duree]
|
|
static final duree = QueryIntegerProperty<Log>(_entities[2].properties[5]);
|
|
|
|
/// see [Log.uploaded]
|
|
static final uploaded = QueryIntegerProperty<Log>(_entities[2].properties[6]);
|
|
}
|
|
|
|
/// [Etab] entity fields to define ObjectBox queries.
|
|
class Etab_ {
|
|
/// see [Etab.id]
|
|
static final id = QueryIntegerProperty<Etab>(_entities[3].properties[0]);
|
|
|
|
/// see [Etab.id_etab]
|
|
static final id_etab = QueryIntegerProperty<Etab>(_entities[3].properties[1]);
|
|
|
|
/// see [Etab.nom]
|
|
static final nom = QueryStringProperty<Etab>(_entities[3].properties[2]);
|
|
|
|
/// see [Etab.mail]
|
|
static final mail = QueryStringProperty<Etab>(_entities[3].properties[3]);
|
|
|
|
/// see [Etab.tel]
|
|
static final tel = QueryStringProperty<Etab>(_entities[3].properties[4]);
|
|
|
|
/// see [Etab.longitude]
|
|
static final longitude =
|
|
QueryStringProperty<Etab>(_entities[3].properties[5]);
|
|
|
|
/// see [Etab.latitude]
|
|
static final latitude = QueryStringProperty<Etab>(_entities[3].properties[6]);
|
|
|
|
/// see [Etab.url_photo_principale]
|
|
static final url_photo_principale =
|
|
QueryStringProperty<Etab>(_entities[3].properties[7]);
|
|
}
|