Package org.hibernate.tuple.entity
Class BytecodeEnhancementMetadataNonPojoImpl
- java.lang.Object
-
- org.hibernate.tuple.entity.BytecodeEnhancementMetadataNonPojoImpl
-
- All Implemented Interfaces:
BytecodeEnhancementMetadata
public class BytecodeEnhancementMetadataNonPojoImpl extends java.lang.Object implements BytecodeEnhancementMetadata
-
-
Constructor Summary
Constructors Constructor Description BytecodeEnhancementMetadataNonPojoImpl(java.lang.String entityName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PersistentAttributeInterceptable
createEnhancedProxy(EntityKey keyToLoad, boolean addEmptyEntry, SharedSessionContractImplementor session)
Create an "enhancement as proxy" instance for the given entityLazyAttributeLoadingInterceptor
extractInterceptor(java.lang.Object entity)
Extract the field interceptor instance from the enhanced entity.BytecodeLazyAttributeInterceptor
extractLazyInterceptor(java.lang.Object entity)
java.lang.String
getEntityName()
The name of the entity to which this metadata applies.LazyAttributesMetadata
getLazyAttributesMetadata()
boolean
hasUnFetchedAttributes(java.lang.Object entity)
void
injectEnhancedEntityAsProxyInterceptor(java.lang.Object entity, EntityKey entityKey, SharedSessionContractImplementor session)
LazyAttributeLoadingInterceptor
injectInterceptor(java.lang.Object entity, java.lang.Object identifier, SharedSessionContractImplementor session)
Build and inject an interceptor instance into the enhanced entity.void
injectInterceptor(java.lang.Object entity, PersistentAttributeInterceptor interceptor, SharedSessionContractImplementor session)
boolean
isAttributeLoaded(java.lang.Object entity, java.lang.String attributeName)
boolean
isEnhancedForLazyLoading()
Has the entity class been bytecode enhanced for lazy loading?
-
-
-
Method Detail
-
getEntityName
public java.lang.String getEntityName()
Description copied from interface:BytecodeEnhancementMetadata
The name of the entity to which this metadata applies.- Specified by:
getEntityName
in interfaceBytecodeEnhancementMetadata
- Returns:
- The entity name
-
isEnhancedForLazyLoading
public boolean isEnhancedForLazyLoading()
Description copied from interface:BytecodeEnhancementMetadata
Has the entity class been bytecode enhanced for lazy loading?- Specified by:
isEnhancedForLazyLoading
in interfaceBytecodeEnhancementMetadata
- Returns:
true
indicates the entity class is enhanced for Hibernate use in lazy loading;false
indicates it is not
-
getLazyAttributesMetadata
public LazyAttributesMetadata getLazyAttributesMetadata()
- Specified by:
getLazyAttributesMetadata
in interfaceBytecodeEnhancementMetadata
-
injectInterceptor
public LazyAttributeLoadingInterceptor injectInterceptor(java.lang.Object entity, java.lang.Object identifier, SharedSessionContractImplementor session) throws NotInstrumentedException
Description copied from interface:BytecodeEnhancementMetadata
Build and inject an interceptor instance into the enhanced entity.- Specified by:
injectInterceptor
in 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
- Throws:
NotInstrumentedException
- Thrown ifBytecodeEnhancementMetadata.isEnhancedForLazyLoading()
returnsfalse
-
injectInterceptor
public void injectInterceptor(java.lang.Object entity, PersistentAttributeInterceptor interceptor, SharedSessionContractImplementor session)
- Specified by:
injectInterceptor
in interfaceBytecodeEnhancementMetadata
-
injectEnhancedEntityAsProxyInterceptor
public void injectEnhancedEntityAsProxyInterceptor(java.lang.Object entity, EntityKey entityKey, SharedSessionContractImplementor session)
- Specified by:
injectEnhancedEntityAsProxyInterceptor
in interfaceBytecodeEnhancementMetadata
-
createEnhancedProxy
public PersistentAttributeInterceptable createEnhancedProxy(EntityKey keyToLoad, boolean addEmptyEntry, SharedSessionContractImplementor session)
Description copied from interface:BytecodeEnhancementMetadata
Create an "enhancement as proxy" instance for the given entity- Specified by:
createEnhancedProxy
in interfaceBytecodeEnhancementMetadata
-
extractInterceptor
public LazyAttributeLoadingInterceptor extractInterceptor(java.lang.Object entity) throws NotInstrumentedException
Description copied from interface:BytecodeEnhancementMetadata
Extract the field interceptor instance from the enhanced entity.- Specified by:
extractInterceptor
in interfaceBytecodeEnhancementMetadata
- Parameters:
entity
- The entity from which to extract the interceptor- Returns:
- The extracted interceptor
- Throws:
NotInstrumentedException
- Thrown ifBytecodeEnhancementMetadata.isEnhancedForLazyLoading()
returnsfalse
-
extractLazyInterceptor
public BytecodeLazyAttributeInterceptor extractLazyInterceptor(java.lang.Object entity) throws NotInstrumentedException
- Specified by:
extractLazyInterceptor
in interfaceBytecodeEnhancementMetadata
- Throws:
NotInstrumentedException
-
hasUnFetchedAttributes
public boolean hasUnFetchedAttributes(java.lang.Object entity)
- Specified by:
hasUnFetchedAttributes
in interfaceBytecodeEnhancementMetadata
-
isAttributeLoaded
public boolean isAttributeLoaded(java.lang.Object entity, java.lang.String attributeName)
- Specified by:
isAttributeLoaded
in interfaceBytecodeEnhancementMetadata
-
-