Package org.hibernate.tuple.entity
Class BytecodeEnhancementMetadataPojoImpl
- java.lang.Object
-
- org.hibernate.tuple.entity.BytecodeEnhancementMetadataPojoImpl
-
- All Implemented Interfaces:
BytecodeEnhancementMetadata
public final class BytecodeEnhancementMetadataPojoImpl extends Object implements BytecodeEnhancementMetadata
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBytecodeEnhancementMetadataPojoImpl(String entityName, Class entityClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean enhancedForLazyLoading, LazyAttributesMetadata lazyAttributesMetadata)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PersistentAttributeInterceptablecreateEnhancedProxy(EntityKey entityKey, boolean addEmptyEntry, SharedSessionContractImplementor session)Create an "enhancement as proxy" instance for the given entityLazyAttributeLoadingInterceptorextractInterceptor(Object entity)Extract the field interceptor instance from the enhanced entity.BytecodeLazyAttributeInterceptorextractLazyInterceptor(Object entity)static BytecodeEnhancementMetadatafrom(PersistentClass persistentClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean allowEnhancementAsProxy)Static constructorStringgetEntityName()The name of the entity to which this metadata applies.LazyAttributesMetadatagetLazyAttributesMetadata()booleanhasUnFetchedAttributes(Object entity)voidinjectEnhancedEntityAsProxyInterceptor(Object entity, EntityKey entityKey, SharedSessionContractImplementor session)LazyAttributeLoadingInterceptorinjectInterceptor(Object entity, Object identifier, SharedSessionContractImplementor session)Build and inject an interceptor instance into the enhanced entity.voidinjectInterceptor(Object entity, PersistentAttributeInterceptor interceptor, SharedSessionContractImplementor session)booleanisAttributeLoaded(Object entity, String attributeName)booleanisEnhancedForLazyLoading()Has the entity class been bytecode enhanced for lazy loading?
-
-
-
Constructor Detail
-
BytecodeEnhancementMetadataPojoImpl
protected BytecodeEnhancementMetadataPojoImpl(String entityName, Class entityClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean enhancedForLazyLoading, LazyAttributesMetadata lazyAttributesMetadata)
-
-
Method Detail
-
from
public static BytecodeEnhancementMetadata from(PersistentClass persistentClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean allowEnhancementAsProxy)
Static constructor
-
getEntityName
public String getEntityName()
Description copied from interface:BytecodeEnhancementMetadataThe name of the entity to which this metadata applies.- Specified by:
getEntityNamein interfaceBytecodeEnhancementMetadata- Returns:
- The entity name
-
isEnhancedForLazyLoading
public boolean isEnhancedForLazyLoading()
Description copied from interface:BytecodeEnhancementMetadataHas the entity class been bytecode enhanced for lazy loading?- Specified by:
isEnhancedForLazyLoadingin interfaceBytecodeEnhancementMetadata- Returns:
trueindicates the entity class is enhanced for Hibernate use in lazy loading;falseindicates it is not
-
getLazyAttributesMetadata
public LazyAttributesMetadata getLazyAttributesMetadata()
- Specified by:
getLazyAttributesMetadatain interfaceBytecodeEnhancementMetadata
-
hasUnFetchedAttributes
public boolean hasUnFetchedAttributes(Object entity)
- Specified by:
hasUnFetchedAttributesin interfaceBytecodeEnhancementMetadata
-
isAttributeLoaded
public boolean isAttributeLoaded(Object entity, String attributeName)
- Specified by:
isAttributeLoadedin interfaceBytecodeEnhancementMetadata
-
extractInterceptor
public LazyAttributeLoadingInterceptor extractInterceptor(Object entity) throws NotInstrumentedException
Description copied from interface:BytecodeEnhancementMetadataExtract the field interceptor instance from the enhanced entity.- Specified by:
extractInterceptorin interfaceBytecodeEnhancementMetadata- Parameters:
entity- The entity from which to extract the interceptor- Returns:
- The extracted interceptor
- Throws:
NotInstrumentedException- Thrown ifBytecodeEnhancementMetadata.isEnhancedForLazyLoading()returnsfalse
-
createEnhancedProxy
public PersistentAttributeInterceptable createEnhancedProxy(EntityKey entityKey, boolean addEmptyEntry, SharedSessionContractImplementor session)
Description copied from interface:BytecodeEnhancementMetadataCreate an "enhancement as proxy" instance for the given entity- Specified by:
createEnhancedProxyin interfaceBytecodeEnhancementMetadata
-
injectInterceptor
public LazyAttributeLoadingInterceptor injectInterceptor(Object entity, Object identifier, SharedSessionContractImplementor session)
Description copied from interface:BytecodeEnhancementMetadataBuild and inject an interceptor instance into the enhanced entity.- Specified by:
injectInterceptorin interfaceBytecodeEnhancementMetadata- Parameters:
entity- The entity into which built interceptor should be injectedsession- The session to which the entity instance belongs.- Returns:
- The built and injected interceptor
-
injectEnhancedEntityAsProxyInterceptor
public void injectEnhancedEntityAsProxyInterceptor(Object entity, EntityKey entityKey, SharedSessionContractImplementor session)
- Specified by:
injectEnhancedEntityAsProxyInterceptorin interfaceBytecodeEnhancementMetadata
-
injectInterceptor
public void injectInterceptor(Object entity, PersistentAttributeInterceptor interceptor, SharedSessionContractImplementor session)
- Specified by:
injectInterceptorin interfaceBytecodeEnhancementMetadata
-
extractLazyInterceptor
public BytecodeLazyAttributeInterceptor extractLazyInterceptor(Object entity) throws NotInstrumentedException
- Specified by:
extractLazyInterceptorin interfaceBytecodeEnhancementMetadata- Throws:
NotInstrumentedException
-
-