platform/angel_orm/lib/src/annotations.dart

32 lines
815 B
Dart
Raw Normal View History

2017-12-07 08:21:49 +00:00
const ORM orm = const ORM();
2017-06-18 04:19:05 +00:00
class ORM {
/// The path to an Angel service that queries objects of the
/// annotated type at runtime.
///
/// Ex. `api/users`, etc.
final String servicePath;
const ORM([this.servicePath]);
2017-06-18 04:19:05 +00:00
}
/// Specifies that the ORM should build a join builder
/// that combines the results of queries on two services.
class Join {
/// The [Model] type to join against.
2017-12-07 08:21:49 +00:00
final Type type;
/// The path to an Angel service that queries objects of the
/// [type] being joined against, at runtime.
///
/// Ex. `api/users`, etc.
final String servicePath;
/// The type of join this is.
final JoinType joinType;
const Join(this.type, this.servicePath, [this.joinType = JoinType.join]);
}
/// The various types of [Join].
enum JoinType { join, left, right, full, self }