minivac
08/09/2024, 12:58 PMclass UserEntity {
val roles by ...
}
so always eager loading the roles without having to include the load
or with
in every queryChantal Loncle
08/10/2024, 3:16 PMEntityClass
functions are open, so you could for example override all()
to always eager load:
class UserEntity(id: EntityID<Int>) : IntEntity(id) {
companion object : IntEntityClass<UserEntity>(UserTable) {
override fun all(): SizedIterable<UserEntity> = super.all().with(UserEntity::roles)
}
val roles by RoleEntity referrersOn RoleTable.user
}