Closed eximius313 closed 5 years ago
That's a one-to-many table relationship according to the database. The parent mapping is also going to cause performance issues unless bytecode enhancement is used, so the warning is valid.
You can always filter events that you think are fine for your application.
It's not one-to-many. It's missing unique because there can be only one null in unique index. It's optional one-to-one (see nullable=true
and optional=true
). Shouldn't Hibernate treat it differently?
It is one-to-many from a database perspective. You should enforce constraints at DB level, not in your application or via annotations.
Let's say we have two entities:
User
andActivationToken
ActivationToken
is created together withUser
creation, but it must survive (for legal purposes) afterUser
deletion. Therefore:And
I think that in such situation MapsId should not be used because we can not
SET NULL
primary key, and havingid
withoultFOREIGN KEY
constraint doesn't look good either, but Hypersistence Optimizer throws: