HHH-17049 Bytecode Enhancement, extra records created for associations created in constructor

(cherry picked from commit e98fccfdae)
This commit is contained in:
Andrea Boriero 2023-09-06 08:59:51 +02:00 committed by Christian Beikov
parent e134c0aadc
commit ef060205c0
2 changed files with 13 additions and 0 deletions

View File

@ -147,6 +147,13 @@ public abstract class AbstractFlushingEventListener implements JpaBootstrapSensi
}
}
private static boolean flushable(EntityEntry entry) {
final Status status = entry.getStatus();
return ( status == Status.MANAGED && entry.getLoadedState() != null )
|| status == Status.SAVING
|| status == Status.READ_ONLY;
}
private void cascadeOnFlush(EventSource session, EntityPersister persister, Object object, PersistContext anything)
throws HibernateException {
final PersistenceContext persistenceContext = session.getPersistenceContextInternal();

View File

@ -9,6 +9,7 @@ package org.hibernate.sql.results.graph.entity.internal;
import org.hibernate.engine.spi.EntityUniqueKey;
import org.hibernate.engine.spi.PersistenceContext;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.internal.log.LoggingHelper;
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.spi.NavigablePath;
@ -111,4 +112,9 @@ public class EntitySelectFetchByUniqueKeyInitializer extends EntitySelectFetchIn
}
return null;
}
@Override
public String toString() {
return "EntitySelectFetchByUniqueKeyInitializer(" + LoggingHelper.toLoggableString( getNavigablePath() ) + ")";
}
}