HHH-18410 Make use of getter/setter cache as much as possible
This commit is contained in:
parent
cca52f8ccc
commit
84e57ef368
|
@ -182,14 +182,14 @@ public abstract class AbstractEntityInsertAction extends EntityAction {
|
|||
if ( attribute.isPluralAttributeMapping() ) {
|
||||
addCollectionKey(
|
||||
attribute.asPluralAttributeMapping(),
|
||||
descriptor.getValue( object, i ),
|
||||
attribute.getValue( object ),
|
||||
persistenceContext
|
||||
);
|
||||
}
|
||||
else if ( attribute.isEmbeddedAttributeMapping() ) {
|
||||
visitEmbeddedAttributeMapping(
|
||||
attribute.asEmbeddedAttributeMapping(),
|
||||
descriptor.getValue( object, i ),
|
||||
attribute.getValue( object ),
|
||||
persistenceContext
|
||||
);
|
||||
}
|
||||
|
|
|
@ -412,7 +412,7 @@ public class StatefulPersistenceContext implements PersistenceContext {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @Nullable EntityHolderImpl getEntityHolder(EntityKey key) {
|
||||
public EntityHolderImpl getEntityHolder(EntityKey key) {
|
||||
return entitiesByKey == null ? null : entitiesByKey.get( key );
|
||||
}
|
||||
|
||||
|
@ -525,7 +525,7 @@ public class StatefulPersistenceContext implements PersistenceContext {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @Nullable EntityHolderImpl removeEntityHolder(EntityKey key) {
|
||||
public EntityHolderImpl removeEntityHolder(EntityKey key) {
|
||||
final EntityHolderImpl holder;
|
||||
if ( entitiesByKey != null ) {
|
||||
holder = entitiesByKey.remove( key );
|
||||
|
@ -1316,7 +1316,7 @@ public class StatefulPersistenceContext implements PersistenceContext {
|
|||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public @Nullable Map<PersistentCollection<?>,CollectionEntry> getCollectionEntries() {
|
||||
public Map<PersistentCollection<?>,CollectionEntry> getCollectionEntries() {
|
||||
return collectionEntries;
|
||||
}
|
||||
|
||||
|
|
|
@ -398,18 +398,7 @@ public class ComponentType extends AbstractType implements CompositeTypeImplemen
|
|||
return ((Object[]) component)[i];
|
||||
}
|
||||
else {
|
||||
final EmbeddableMappingType embeddableMappingType = embeddableTypeDescriptor();
|
||||
if ( embeddableMappingType.isPolymorphic() ) {
|
||||
final EmbeddableMappingType.ConcreteEmbeddableType concreteEmbeddableType = embeddableMappingType.findSubtypeBySubclass(
|
||||
component.getClass().getName()
|
||||
);
|
||||
return concreteEmbeddableType.declaresAttribute( i )
|
||||
? embeddableMappingType.getValue( component, i )
|
||||
: null;
|
||||
}
|
||||
else {
|
||||
return embeddableMappingType.getValue( component, i );
|
||||
}
|
||||
return embeddableTypeDescriptor().getValue( component, i );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue