// select only user, all ref fields fetched as refs by default
val user = query<UserExt>(UserExt::name eq "user")
assertTrue(user.father is User)
assertTrue(user.mother is User)
// select user and his father
val queryGraph = root(UserExt::class) {
UserExt::father fetchAs UserExt::class
}
val userWithFather = query<UserExt>(UserExt::name eq "user")
assertTrue(user.father is User)
assertTrue(user.mother is UserId)
Motivation: provide user simple way to express exact form required entites graph
The general idea is following
First of all, allow user to create several classes with different fields mapped to the same entity collection:
And then allow user to define refs in schema definition:
And finally allow user to express adhoc query:
Motivation: provide user simple way to express exact form required entites graph
Problems/questions: 1) Recursive types
Relates to: #51