d-r-q / qbit

qbit is a kotlin-multiplatform embeddable decentralized DBMS with object-relational information model
44 stars 9 forks source link

Entity reference as attribute value #78

Open d-r-q opened 4 years ago

d-r-q commented 4 years ago

Support special interface or convention, that will allow user to set only gid, to refer an entity.

Example:

interface Entity<T> {
    val id: Gid
}
class Ref<T> (override id: Gid) : Entity<T>
class User (override id: Gid?, name: String, friend: Entity<User>) : Entity<User>

val newUser = User(null, "New User", Ref(oldUserGid))

Reference attrs may be fetched lazy or eagerly on query by query basis or defined in a view

Relates #77