$$AppUserTableTableManager constructor
$$AppUserTableTableManager(
- _$SharedDatabase db,
- $AppUserTable table
Implementation
$$AppUserTableTableManager(_$SharedDatabase db, $AppUserTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$AppUserTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$AppUserTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$AppUserTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<String> userName = const Value.absent(),
Value<String> email = const Value.absent(),
Value<String> fullName = const Value.absent(),
Value<String> encryptedPassword = const Value.absent(),
Value<bool> enabled = const Value.absent(),
Value<bool> activated = const Value.absent(),
Value<String?> accessToken = const Value.absent(),
Value<int?> employeeId = const Value.absent(),
Value<DateTime?> lastActiveDatetime = const Value.absent(),
Value<bool> isSystemUser = const Value.absent(),
Value<String?> imagePath = const Value.absent(),
}) => AppUserCompanion(
id: id,
userName: userName,
email: email,
fullName: fullName,
encryptedPassword: encryptedPassword,
enabled: enabled,
activated: activated,
accessToken: accessToken,
employeeId: employeeId,
lastActiveDatetime: lastActiveDatetime,
isSystemUser: isSystemUser,
imagePath: imagePath,
),
createCompanionCallback:
({
Value<int> id = const Value.absent(),
required String userName,
required String email,
required String fullName,
required String encryptedPassword,
required bool enabled,
required bool activated,
Value<String?> accessToken = const Value.absent(),
Value<int?> employeeId = const Value.absent(),
Value<DateTime?> lastActiveDatetime = const Value.absent(),
required bool isSystemUser,
Value<String?> imagePath = const Value.absent(),
}) => AppUserCompanion.insert(
id: id,
userName: userName,
email: email,
fullName: fullName,
encryptedPassword: encryptedPassword,
enabled: enabled,
activated: activated,
accessToken: accessToken,
employeeId: employeeId,
lastActiveDatetime: lastActiveDatetime,
isSystemUser: isSystemUser,
imagePath: imagePath,
),
withReferenceMapper: (p0) => p0
.map(
(e) => (
e.readTable(table),
$$AppUserTableReferences(db, table, e),
),
)
.toList(),
prefetchHooksCallback:
({employeeId = false, contributorRefs = false}) {
return PrefetchHooks(
db: db,
explicitlyWatchedTables: [
if (contributorRefs) db.contributor,
],
addJoins:
<
T extends TableManagerState<
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic
>
>(state) {
if (employeeId) {
state =
state.withJoin(
currentTable: table,
currentColumn: table.employeeId,
referencedTable: $$AppUserTableReferences
._employeeIdTable(db),
referencedColumn: $$AppUserTableReferences
._employeeIdTable(db)
.id,
)
as T;
}
return state;
},
getPrefetchedDataCallback: (items) async {
return [
if (contributorRefs)
await $_getPrefetchedData<
AppUserData,
$AppUserTable,
ContributorData
>(
currentTable: table,
referencedTable: $$AppUserTableReferences
._contributorRefsTable(db),
managerFromTypedResult: (p0) =>
$$AppUserTableReferences(
db,
table,
p0,
).contributorRefs,
referencedItemsForCurrentItem:
(item, referencedItems) => referencedItems.where(
(e) => e.appUserId == item.id,
),
typedResults: items,
),
];
},
);
},
),
);