very minor whitespace fixes

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-05-22 00:00:54 +02:00
parent 522269e9a9
commit 8ea4d6a3c0
1 changed files with 7 additions and 5 deletions

View File

@ -4133,12 +4133,13 @@ public abstract class AbstractEntityPersister
if ( isUnsaved != null ) { if ( isUnsaved != null ) {
if ( isUnsaved ) { if ( isUnsaved ) {
final PersistenceContext persistenceContext; final PersistenceContext persistenceContext;
if ( version == null && ( persistenceContext = session.getPersistenceContext() ).hasLoadContext() if ( version == null
&& !persistenceContext.getLoadContexts().isLoadingFinished() ) { && ( persistenceContext = session.getPersistenceContext() ).hasLoadContext()
&& !persistenceContext.getLoadContexts().isLoadingFinished() ) {
// check if we're currently loading this entity instance, the version // check if we're currently loading this entity instance, the version
// will be null but the entity cannot be considered transient // will be null but the entity cannot be considered transient
final EntityHolder holder = persistenceContext final EntityHolder holder =
.getEntityHolder( new EntityKey( id, this ) ); persistenceContext.getEntityHolder( new EntityKey( id, this ) );
if ( holder != null && holder.isEventuallyInitialized() && holder.getEntity() == entity ) { if ( holder != null && holder.isEventuallyInitialized() && holder.getEntity() == entity ) {
return false; return false;
} }
@ -4148,7 +4149,8 @@ public abstract class AbstractEntityPersister
final Boolean unsaved = identifierMapping.getUnsavedStrategy().isUnsaved( id ); final Boolean unsaved = identifierMapping.getUnsavedStrategy().isUnsaved( id );
if ( unsaved != null && !unsaved ) { if ( unsaved != null && !unsaved ) {
throw new PropertyValueException( throw new PropertyValueException(
"Detached entity with generated id '" + id + "' has an uninitialized version value '" + version + "'", "Detached entity with generated id '" + id
+ "' has an uninitialized version value '" + version + "'",
getEntityName(), getEntityName(),
getVersionColumnName() getVersionColumnName()
); );