platform/angel_orm_generator/test/models/car.g.dart

154 lines
3.5 KiB
Dart
Raw Normal View History

2018-08-24 13:42:09 +00:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of angel_orm.generator.models.car;
2018-12-01 19:03:43 +00:00
// **************************************************************************
// OrmGenerator
// **************************************************************************
class CarQuery extends Query<Car, CarQueryWhere> {
@override
final CarQueryWhere where = new CarQueryWhere();
@override
get tableName {
return 'cars';
}
@override
get fields {
2018-12-03 13:41:14 +00:00
return CarFields.allFields;
2018-12-01 19:03:43 +00:00
}
@override
deserialize(List row) {
return new Car(
2018-12-03 13:41:14 +00:00
id: row[0].toString(),
make: (row[1] as String),
description: (row[2] as String),
familyFriendly: (row[3] as bool),
recalledAt: (row[4] as DateTime),
createdAt: (row[5] as DateTime),
updatedAt: (row[6] as DateTime));
2018-12-01 19:03:43 +00:00
}
}
class CarQueryWhere extends QueryWhere {
2018-12-03 13:41:14 +00:00
final NumericSqlExpressionBuilder<int> id =
new NumericSqlExpressionBuilder<int>('id');
2018-12-01 19:03:43 +00:00
final StringSqlExpressionBuilder make =
new StringSqlExpressionBuilder('make');
final StringSqlExpressionBuilder description =
new StringSqlExpressionBuilder('description');
final BooleanSqlExpressionBuilder familyFriendly =
new BooleanSqlExpressionBuilder('family_friendly');
final DateTimeSqlExpressionBuilder recalledAt =
new DateTimeSqlExpressionBuilder('recalled_at');
final DateTimeSqlExpressionBuilder createdAt =
new DateTimeSqlExpressionBuilder('created_at');
final DateTimeSqlExpressionBuilder updatedAt =
new DateTimeSqlExpressionBuilder('updated_at');
@override
get expressionBuilders {
return [
id,
make,
description,
familyFriendly,
recalledAt,
createdAt,
updatedAt
];
}
}
2018-08-24 13:42:09 +00:00
// **************************************************************************
// JsonModelGenerator
// **************************************************************************
@generatedSerializable
class Car extends _Car {
Car(
{this.id,
this.make,
this.description,
this.familyFriendly,
this.recalledAt,
this.createdAt,
this.updatedAt});
@override
final String id;
@override
final String make;
@override
final String description;
@override
final bool familyFriendly;
@override
final DateTime recalledAt;
@override
final DateTime createdAt;
@override
final DateTime updatedAt;
Car copyWith(
{String id,
String make,
String description,
bool familyFriendly,
DateTime recalledAt,
DateTime createdAt,
DateTime updatedAt}) {
return new Car(
id: id ?? this.id,
make: make ?? this.make,
description: description ?? this.description,
familyFriendly: familyFriendly ?? this.familyFriendly,
recalledAt: recalledAt ?? this.recalledAt,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt);
}
bool operator ==(other) {
return other is _Car &&
other.id == id &&
other.make == make &&
other.description == description &&
other.familyFriendly == familyFriendly &&
other.recalledAt == recalledAt &&
other.createdAt == createdAt &&
other.updatedAt == updatedAt;
}
2018-12-01 19:03:43 +00:00
@override
int get hashCode {
return hashObjects([
id,
make,
description,
familyFriendly,
recalledAt,
createdAt,
updatedAt
]);
}
2018-08-24 13:42:09 +00:00
Map<String, dynamic> toJson() {
return CarSerializer.toMap(this);
}
}