123
03/12/2021, 5:07 PMA
and A_Log
with relations:
@Entity data class A (val log: A_Log)
@Entity data class A_Log(val a: A, val price: Int)
And a method which persists them:
@Transactional fun persist(val dto: PriceDto) {
val a: A = A(???)
val log: A_Log = (a, price = dto.price)
// persist methods
}
I think the problem is clear, any way to solve this egg-or-chicken problem except making fields nullable and using (!!
) elsewhere in code?Jaco
03/12/2021, 5:22 PM123
03/12/2021, 6:06 PM123
03/12/2021, 6:20 PMjbnizet
03/12/2021, 9:56 PM