Skip to content

Commit 84e57ef

Browse files
committed
HHH-18410 Make use of getter/setter cache as much as possible
1 parent cca52f8 commit 84e57ef

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

hibernate-core/src/main/java/org/hibernate/action/internal/AbstractEntityInsertAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,14 @@ private void visitEmbeddedAttributeMapping(
182182
if ( attribute.isPluralAttributeMapping() ) {
183183
addCollectionKey(
184184
attribute.asPluralAttributeMapping(),
185-
descriptor.getValue( object, i ),
185+
attribute.getValue( object ),
186186
persistenceContext
187187
);
188188
}
189189
else if ( attribute.isEmbeddedAttributeMapping() ) {
190190
visitEmbeddedAttributeMapping(
191191
attribute.asEmbeddedAttributeMapping(),
192-
descriptor.getValue( object, i ),
192+
attribute.getValue( object ),
193193
persistenceContext
194194
);
195195
}

hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public EntityHolder claimEntityHolderIfPossible(
412412
}
413413

414414
@Override
415-
public @Nullable EntityHolderImpl getEntityHolder(EntityKey key) {
415+
public EntityHolderImpl getEntityHolder(EntityKey key) {
416416
return entitiesByKey == null ? null : entitiesByKey.get( key );
417417
}
418418

@@ -525,7 +525,7 @@ public Object removeEntity(EntityKey key) {
525525
}
526526

527527
@Override
528-
public @Nullable EntityHolderImpl removeEntityHolder(EntityKey key) {
528+
public EntityHolderImpl removeEntityHolder(EntityKey key) {
529529
final EntityHolderImpl holder;
530530
if ( entitiesByKey != null ) {
531531
holder = entitiesByKey.remove( key );
@@ -1316,7 +1316,7 @@ public int getNumberOfManagedEntities() {
13161316
*/
13171317
@Override
13181318
@Deprecated
1319-
public @Nullable Map<PersistentCollection<?>,CollectionEntry> getCollectionEntries() {
1319+
public Map<PersistentCollection<?>,CollectionEntry> getCollectionEntries() {
13201320
return collectionEntries;
13211321
}
13221322

hibernate-core/src/main/java/org/hibernate/type/ComponentType.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -398,18 +398,7 @@ else if ( component instanceof Object[] ) {
398398
return ((Object[]) component)[i];
399399
}
400400
else {
401-
final EmbeddableMappingType embeddableMappingType = embeddableTypeDescriptor();
402-
if ( embeddableMappingType.isPolymorphic() ) {
403-
final EmbeddableMappingType.ConcreteEmbeddableType concreteEmbeddableType = embeddableMappingType.findSubtypeBySubclass(
404-
component.getClass().getName()
405-
);
406-
return concreteEmbeddableType.declaresAttribute( i )
407-
? embeddableMappingType.getValue( component, i )
408-
: null;
409-
}
410-
else {
411-
return embeddableMappingType.getValue( component, i );
412-
}
401+
return embeddableTypeDescriptor().getValue( component, i );
413402
}
414403
}
415404

0 commit comments

Comments
 (0)