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

98 lines
2.3 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.test.models.role;
2018-12-01 19:03:43 +00:00
// **************************************************************************
// OrmGenerator
// **************************************************************************
class RoleQuery extends Query<Role, RoleQueryWhere> {
@override
final RoleQueryWhere where = new RoleQueryWhere();
@override
get tableName {
return 'roles';
}
@override
get fields {
2018-12-03 13:41:14 +00:00
return RoleFields.allFields;
2018-12-01 19:03:43 +00:00
}
@override
deserialize(List row) {
return new Role(
2018-12-03 13:41:14 +00:00
id: row[0].toString(),
name: (row[1] as String),
createdAt: (row[2] as DateTime),
updatedAt: (row[3] as DateTime));
2018-12-01 19:03:43 +00:00
}
}
class RoleQueryWhere 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 name =
new StringSqlExpressionBuilder('name');
final DateTimeSqlExpressionBuilder createdAt =
new DateTimeSqlExpressionBuilder('created_at');
final DateTimeSqlExpressionBuilder updatedAt =
new DateTimeSqlExpressionBuilder('updated_at');
@override
get expressionBuilders {
return [id, name, createdAt, updatedAt];
}
}
2018-08-24 13:42:09 +00:00
// **************************************************************************
// JsonModelGenerator
// **************************************************************************
@generatedSerializable
class Role extends _Role {
Role({this.id, this.name, this.createdAt, this.updatedAt});
@override
final String id;
@override
final String name;
@override
final DateTime createdAt;
@override
final DateTime updatedAt;
Role copyWith(
{String id, String name, DateTime createdAt, DateTime updatedAt}) {
return new Role(
id: id ?? this.id,
name: name ?? this.name,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt);
}
bool operator ==(other) {
return other is _Role &&
other.id == id &&
other.name == name &&
other.createdAt == createdAt &&
other.updatedAt == updatedAt;
}
2018-12-01 19:03:43 +00:00
@override
int get hashCode {
return hashObjects([id, name, createdAt, updatedAt]);
}
2018-08-24 13:42:09 +00:00
Map<String, dynamic> toJson() {
return RoleSerializer.toMap(this);
}
}