Skip to content

Commit

Permalink
--wip-- test improvement to entity entry wrt row-id
Browse files Browse the repository at this point in the history
  • Loading branch information
mbladel committed Dec 22, 2023
1 parent a770426 commit c2a25c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,13 @@ public final void makeEntityManaged() {
nullifyTransientReferencesIfNotAlready();
final Object version = getVersion( getState(), getPersister() );
final PersistenceContext persistenceContextInternal = getSession().getPersistenceContextInternal();
persistenceContextInternal.addEntity(
persistenceContextInternal.addEntity( getEntityKey(), getInstance() );
persistenceContextInternal.addEntry(
getInstance(),
( getPersister().isMutable() ? Status.MANAGED : Status.READ_ONLY ),
getState(),
getEntityKey(),
getRowId(),
getEntityKey().getIdentifier(),
version,
LockMode.WRITE,
isExecuted,
Expand All @@ -146,10 +148,6 @@ public final void makeEntityManaged() {
);
if ( isEarlyInsert() ) {
addCollectionsByKeyToPersistenceContext( persistenceContextInternal, getState() );
final Object rowId = getRowId();
if ( rowId != null ) {
persistenceContextInternal.replaceEntityEntryRowId( getInstance(), rowId );
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ public void execute() throws HibernateException {
// Process row-id values when available early by replacing the entity entry
if ( persister.getRowIdMapping() != null ) {
rowId = generatedValues.getGeneratedValue( persister.getRowIdMapping() );
if ( rowId != null && isDelayed ) {
persistenceContext.replaceEntityEntryRowId( getInstance(), rowId );
}
}
if ( persister.hasInsertGeneratedProperties() ) {
persister.processInsertGeneratedProperties( generatedId, instance, getState(), generatedValues, session );
Expand Down

0 comments on commit c2a25c3

Please sign in to comment.