- Support self-joins. Models can now have relations to itself.
- Added
value
property toQueryParams
to supply custom query parameters. - Added
@BindTo()
annotation to resolve ambiguous field relations.
When you have multiple relations between the same types, it may be ambiguous fields refer to each other.
In those cases, you can use the @BindTo(#otherField)
annotation like this:
@Model()
abstract class User {
@PrimaryKey()
String get id;
@BindTo(#author)
List<Post> get posts;
@BindTo(#likes)
List<Post> get liked;
}
@Model()
abstract class Post {
@PrimaryKey()
String get id;
@BindTo(#posts)
User get author;
@BindTo(#liked)
List<User> get likes;
}