Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions hibernate-core/src/main/java/org/hibernate/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,8 @@
* <p>
* Each persistent instance has a <em>persistent identity</em> determined by its type
* and identifier value. There may be at most one persistent instance with a given
* persistent identity associated with a given session. Normally, a persistent identity
* is assigned when an {@linkplain #persist(Object) instance is made persistent}, but
* when the entity identifier is {@linkplain org.hibernate.generator.OnExecutionGenerator
* generated by the database}, assignment of the persistent identity is delayed until
* the state of the entity is actually inserted in the database.
* persistent identity associated with a given session. A persistent identity is
* assigned when an {@linkplain #persist(Object) instance is made persistent}.
* <p>
* An instance of an entity class may be associated with at most one open session.
* Distinct sessions represent state with the same persistent identity using distinct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ protected Object performSaveOrReplicate(

private static Object handleGeneratedId(boolean useIdentityColumn, Object id, AbstractEntityInsertAction insert) {
if ( useIdentityColumn && insert.isEarlyInsert() ) {
if ( insert instanceof EntityIdentityInsertAction ) {
final Object generatedId = ((EntityIdentityInsertAction) insert).getGeneratedId();
if ( insert instanceof EntityIdentityInsertAction entityIdentityInsertAction ) {
final Object generatedId = entityIdentityInsertAction.getGeneratedId();
insert.handleNaturalIdPostSaveNotifications( generatedId );
return generatedId;
}
Expand Down
Loading