| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- // GENERATED CODE - DO NOT MODIFY BY HAND
- // ignore_for_file: camel_case_types
- import 'dart:typed_data';
- import 'package:objectbox/flatbuffers/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 'entity/login.dart';
- export 'package:objectbox/objectbox.dart'; // so that callers only have to import this file
- final _entities = <ModelEntity>[
- ModelEntity(
- id: const IdUid(1, 3444477729893015694),
- name: 'User',
- lastPropertyId: const IdUid(2, 2305308568754167021),
- flags: 0,
- properties: <ModelProperty>[
- ModelProperty(
- id: const IdUid(1, 5463014948149082651),
- name: 'id',
- type: 6,
- flags: 1),
- ModelProperty(
- id: const IdUid(2, 2305308568754167021),
- name: 'username',
- type: 9,
- flags: 2080,
- indexId: const IdUid(1, 2185831944762227781))
- ],
- 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(1, 3444477729893015694),
- lastIndexId: const IdUid(1, 2185831944762227781),
- lastRelationId: const IdUid(0, 0),
- lastSequenceId: const IdUid(0, 0),
- retiredEntityUids: const [],
- retiredIndexUids: const [],
- retiredPropertyUids: const [],
- retiredRelationUids: const [],
- modelVersion: 5,
- modelVersionParserMinimum: 5,
- version: 1);
- final bindings = <Type, EntityDefinition>{
- Login: EntityDefinition<Login>(
- model: _entities[0],
- toOneRelations: (Login object) => [],
- toManyRelations: (Login object) => {},
- getId: (Login object) => object.id,
- setId: (Login object, int id) {
- object.id = id;
- },
- objectToFB: (Login object, fb.Builder fbb) {
- final usernameOffset = fbb.writeString(object.username);
- fbb.startTable(3);
- fbb.addInt64(0, object.id);
- fbb.addOffset(1, usernameOffset);
- fbb.finish(fbb.endTable());
- return object.id;
- },
- objectFromFB: (Store store, ByteData fbData) {
- final buffer = fb.BufferContext(fbData);
- final rootOffset = buffer.derefObject(0);
- final object = Login(
- username:
- const fb.StringReader().vTableGet(buffer, rootOffset, 6, ''))
- ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0);
- return object;
- })
- };
- return ModelDefinition(model, bindings);
- }
- /// [Login] entity fields to define ObjectBox queries.
- class User_ {
- /// see [Login.id]
- static final id = QueryIntegerProperty<Login>(_entities[0].properties[0]);
- /// see [Login.username]
- static final username = QueryStringProperty<Login>(_entities[0].properties[1]);
- }
|