Currently I have the below mapping that was working very well in hibernate 5, but now I got an error by the type check introduced by this ticket.([https://hibernate.atlassian.net/browse/HHH-16313|https://hibernate.atlassian.net/browse/HHH-16313|smart-link] )
The reason why I map like this is that
* I can leverage the efficiency of bidirectional mapping * I don’t need to reference from child to parent. (semi-bidirectional) This pattern probably works when primary key is generated in server side(like UUID), not DB generated unique id as it is determined before I persist them.
Is it possible to use the below pattern in hibernate 6? or there is any workaround at this moment?
{code:java} @Entity public static class EntityA { @Id private UUID id;
@OneToMany( mappedBy = "entityAId" ) private List<EntityB> twos; }
@Entity public static class EntityB { @Id private Long id;
private UUID entityAId; }{code} |
|