dave08
01/03/2023, 5:01 PMEntityStore
would have been better if they were generated and defined ONCE and not just when trying to retrieve data... one can easily make a mistake and use the wrong thing as the one and the many... when declaring the entities and relations, we tend to check the db structures and make sure the relations are right, from then on, the querying should only give the RIGHT options for the situation...Toshihiro Nakamura
01/03/2023, 10:59 PMdave08
01/04/2023, 11:05 AMclass Address {
...
@KommapperForeignKey(Person::class)
val personId: Int
that would let Komapper know at compile time how to link things, then the Meta class could maybe have extra fields to be used by the EntityStore to retrieve the appropriate thing for a certain field in a Person, say, a list of addresses (one to many or many to many, etc...) or a tutor (many to one).Toshihiro Nakamura
01/04/2023, 12:36 PMdave08
01/04/2023, 12:38 PM@KomapperOneToMany
etc..., just a @KomapperForeignKey
which would give a hint to help out expressing the relationships correctly in queries...dave08
01/04/2023, 12:47 PMfun Person.addresses(es: EntityStore): List<Address>
To help avoid a bunch of boilerplate map lookups?dave08
01/04/2023, 12:47 PMdave08
01/04/2023, 12:48 PMToshihiro Nakamura
01/04/2023, 12:55 PM