map method

  1. @override
EmploymentHistoryData map(
  1. Map<String, dynamic> data, {
  2. String? tablePrefix,
})

Maps the given row returned by the database into the fitting data class.

Implementation

@override
EmploymentHistoryData map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return EmploymentHistoryData(
    id: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}id'],
    )!,
    employeeId: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}employee_id'],
    )!,
    employeePositionId: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}employee_position_id'],
    )!,
    departmentId: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}department_id'],
    )!,
    companyId: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}company_id'],
    )!,
    fromDate: attachedDatabase.typeMapping.read(
      DriftSqlType.dateTime,
      data['${effectivePrefix}from_date'],
    )!,
    toDate: attachedDatabase.typeMapping.read(
      DriftSqlType.dateTime,
      data['${effectivePrefix}to_date'],
    )!,
  );
}