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> {
|
2018-12-03 16:50:43 +00:00
|
|
|
@override
|
|
|
|
final RoleQueryValues values = new RoleQueryValues();
|
|
|
|
|
2018-12-01 19:03:43 +00:00
|
|
|
@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
|
|
|
}
|
|
|
|
|
2018-12-03 16:50:43 +00:00
|
|
|
@override
|
|
|
|
RoleQueryWhere newWhereClause() {
|
|
|
|
return new RoleQueryWhere();
|
|
|
|
}
|
|
|
|
|
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-12-03 16:50:43 +00:00
|
|
|
class RoleQueryValues extends MapQueryValues {
|
|
|
|
int get id {
|
|
|
|
return (values['id'] as int);
|
|
|
|
}
|
|
|
|
|
|
|
|
void set id(int value) => values['id'] = value;
|
|
|
|
String get name {
|
|
|
|
return (values['name'] as String);
|
|
|
|
}
|
|
|
|
|
|
|
|
void set name(String value) => values['name'] = value;
|
|
|
|
DateTime get createdAt {
|
|
|
|
return (values['created_at'] as DateTime);
|
|
|
|
}
|
|
|
|
|
|
|
|
void set createdAt(DateTime value) => values['created_at'] = value;
|
|
|
|
DateTime get updatedAt {
|
|
|
|
return (values['updated_at'] as DateTime);
|
|
|
|
}
|
|
|
|
|
|
|
|
void set updatedAt(DateTime value) => values['updated_at'] = value;
|
|
|
|
void copyFrom(Role model) {
|
|
|
|
values.addAll({
|
|
|
|
'name': model.name,
|
|
|
|
'created_at': model.createdAt,
|
|
|
|
'updated_at': model.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);
|
|
|
|
}
|
|
|
|
}
|