$$EmploymentHistoryTableTableManager constructor
$$EmploymentHistoryTableTableManager(
- _$SharedDatabase db,
- $EmploymentHistoryTable table
Implementation
$$EmploymentHistoryTableTableManager(
_$SharedDatabase db,
$EmploymentHistoryTable table,
) : super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$EmploymentHistoryTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$EmploymentHistoryTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$EmploymentHistoryTableAnnotationComposer(
$db: db,
$table: table,
),
updateCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<int> employeeId = const Value.absent(),
Value<int> employeePositionId = const Value.absent(),
Value<int> departmentId = const Value.absent(),
Value<int> companyId = const Value.absent(),
Value<DateTime> fromDate = const Value.absent(),
Value<DateTime> toDate = const Value.absent(),
}) => EmploymentHistoryCompanion(
id: id,
employeeId: employeeId,
employeePositionId: employeePositionId,
departmentId: departmentId,
companyId: companyId,
fromDate: fromDate,
toDate: toDate,
),
createCompanionCallback:
({
Value<int> id = const Value.absent(),
required int employeeId,
required int employeePositionId,
required int departmentId,
required int companyId,
required DateTime fromDate,
required DateTime toDate,
}) => EmploymentHistoryCompanion.insert(
id: id,
employeeId: employeeId,
employeePositionId: employeePositionId,
departmentId: departmentId,
companyId: companyId,
fromDate: fromDate,
toDate: toDate,
),
withReferenceMapper: (p0) => p0
.map(
(e) => (
e.readTable(table),
$$EmploymentHistoryTableReferences(db, table, e),
),
)
.toList(),
prefetchHooksCallback:
({
employeeId = false,
employeePositionId = false,
departmentId = false,
companyId = false,
}) {
return PrefetchHooks(
db: db,
explicitlyWatchedTables: [],
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:
$$EmploymentHistoryTableReferences
._employeeIdTable(db),
referencedColumn:
$$EmploymentHistoryTableReferences
._employeeIdTable(db)
.id,
)
as T;
}
if (employeePositionId) {
state =
state.withJoin(
currentTable: table,
currentColumn: table.employeePositionId,
referencedTable:
$$EmploymentHistoryTableReferences
._employeePositionIdTable(db),
referencedColumn:
$$EmploymentHistoryTableReferences
._employeePositionIdTable(db)
.id,
)
as T;
}
if (departmentId) {
state =
state.withJoin(
currentTable: table,
currentColumn: table.departmentId,
referencedTable:
$$EmploymentHistoryTableReferences
._departmentIdTable(db),
referencedColumn:
$$EmploymentHistoryTableReferences
._departmentIdTable(db)
.id,
)
as T;
}
if (companyId) {
state =
state.withJoin(
currentTable: table,
currentColumn: table.companyId,
referencedTable:
$$EmploymentHistoryTableReferences
._companyIdTable(db),
referencedColumn:
$$EmploymentHistoryTableReferences
._companyIdTable(db)
.id,
)
as T;
}
return state;
},
getPrefetchedDataCallback: (items) async {
return [];
},
);
},
),
);