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

97 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 {
return const ['id', 'name', 'createdAt', 'updatedAt'];
}
@override
deserialize(List row) {
return new Role(
id: (row[0] as String),
name: (row[0] as String),
createdAt: (row[0] as DateTime),
updatedAt: (row[0] as DateTime));
}
}
class RoleQueryWhere extends QueryWhere {
final StringSqlExpressionBuilder id = new StringSqlExpressionBuilder('id');
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);
}
}