platform/angel_orm_generator/test/models/user.dart

40 lines
701 B
Dart
Raw Normal View History

library angel_orm_generator.test.models.user;
import 'package:angel_model/angel_model.dart';
import 'package:angel_orm/angel_orm.dart';
import 'package:angel_serialize/angel_serialize.dart';
2018-12-03 13:41:14 +00:00
import 'package:collection/collection.dart';
part 'user.g.dart';
@serializable
2018-12-01 19:03:43 +00:00
@orm
2018-12-08 22:51:27 +00:00
abstract class _User extends Model {
String get username;
String get password;
String get email;
2018-12-08 22:51:27 +00:00
@hasMany
List<_UserRole> get userRoles;
}
@serializable
@orm
abstract class _Role extends Model {
String name;
@hasMany
List<_UserRole> get userRoles;
}
@Serializable(autoIdAndDateFields: false)
@orm
abstract class _UserRole {
int get id;
@belongsTo
_User get user;
@belongsTo
_Role get role;
2018-12-03 13:41:14 +00:00
}