Closed uladkasach closed 3 years ago
alternatively, maybe we can detect that it is a reference on our own by seeing that there's another domain object having a dao generated for it that has the same name (minus the 'uuid') part
i.e., we see that we're generating dao for
interface User {
...
}
interface Profile {
userUuid: string,
...
}
which we can use to tell us
userUuid => references user.id
we can also allow specifying this references
explicitly in the schema-dao-generator
config, to keep the domain object definition clean. e.g., we add metadata for the dao generator in that config file
done through implicit uuid reference
specifically,
-- prefer this interface Profile { userUuid: string; picture: Image; }
which means that somehow we have to tell the dao generator that in case 2,
userUuid
is actually a reference toUser
one way we can do that is by defining a static property called
references
(in contrast tonested
)so...
references
would look something like thisso note how we dont have to specify the references that can be derived impicitly (i.e., we can see that Image references image)
but we do have to specify the references that can not be derived implicitly