Skip to content

Commit

Permalink
Merge pull request #1432 from EddyVerbruggen/master
Browse files Browse the repository at this point in the history
Better compatibility with Hibernate Envers
  • Loading branch information
xael-fry authored Oct 16, 2023
2 parents c6fe899 + 33b00eb commit ee3958a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions framework/src/play/db/jpa/HibernateInterceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class HibernateInterceptor extends EmptyInterceptor {
public HibernateInterceptor() {

}

@Override
public int[] findDirty(Object o, Serializable id, Object[] arg2, Object[] arg3, String[] arg4, Type[] arg5) {
if (o instanceof JPABase && !((JPABase) o).willBeSaved) {
Expand All @@ -27,7 +27,7 @@ public boolean onCollectionUpdate(Object collection, Serializable key) throws Ca
if (collection instanceof PersistentCollection) {
Object o = ((PersistentCollection) collection).getOwner();
if (o instanceof JPABase) {
if (entities.get() != null) {
if (entities.get() instanceof JPABase) {
return ((JPABase) o).willBeSaved || ((JPABase) entities.get()).willBeSaved;
} else {
return ((JPABase) o).willBeSaved;
Expand All @@ -44,7 +44,7 @@ public boolean onCollectionRecreate(Object collection, Serializable key) throws
if (collection instanceof PersistentCollection) {
Object o = ((PersistentCollection) collection).getOwner();
if (o instanceof JPABase) {
if (entities.get() != null) {
if (entities.get() instanceof JPABase) {
return ((JPABase) o).willBeSaved || ((JPABase) entities.get()).willBeSaved;
} else {
return ((JPABase) o).willBeSaved;
Expand All @@ -62,7 +62,7 @@ public boolean onCollectionRemove(Object collection, Serializable key) throws Ca
if (collection instanceof PersistentCollection) {
Object o = ((PersistentCollection) collection).getOwner();
if (o instanceof JPABase) {
if (entities.get() != null) {
if (entities.get() instanceof JPABase) {
return ((JPABase) o).willBeSaved || ((JPABase) entities.get()).willBeSaved;
} else {
return ((JPABase) o).willBeSaved;
Expand Down

0 comments on commit ee3958a

Please sign in to comment.