Relative Content

Tag Archive for hibernatejpa

Native Query issues Upgrading from JPA 2.2 to JPA 3.1

I am upgrading Hibernate 5.16 using JPA 2.2 to Hibernate 6.5.2 using JPA 3.1.
During start up it is now validating all the Named Queries which I am sure it never did before – it seems to be treating the results of SQL functions as a java.Objects so I had a query below

which it objected to with this error

Inconsistent orphan removal on ManyToMany with CascadeType.ALL

Hibernate 6 does not cascade REMOVE operation with @ManyToMany(cascade = CascadeType.ALL) most of the time (due to BasicCollectionPersister.isCascadeDeleteEnabled always returning false) but seems to do so on that same collection mapped with @ManyToMany if cascading is started with an entity containing @OneToMany with orphanRemoval = true. Is this intended behavior?