Package org.hibernate.bytecode.spi
Interface BytecodeEnhancementMetadata
-
- All Known Implementing Classes:
BytecodeEnhancementMetadataNonPojoImpl
,BytecodeEnhancementMetadataPojoImpl
public interface BytecodeEnhancementMetadata
Encapsulates bytecode enhancement information about a particular entity.
-
-
Method Summary
All Methods Instance Methods Abstract 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
java.lang.String getEntityName()
The name of the entity to which this metadata applies.- Returns:
- The entity name
-
isEnhancedForLazyLoading
boolean isEnhancedForLazyLoading()
Has the entity class been bytecode enhanced for lazy loading?- Returns:
true
indicates the entity class is enhanced for Hibernate use in lazy loading;false
indicates it is not
-
getLazyAttributesMetadata
LazyAttributesMetadata getLazyAttributesMetadata()
-
createEnhancedProxy
PersistentAttributeInterceptable createEnhancedProxy(EntityKey keyToLoad, boolean addEmptyEntry, SharedSessionContractImplementor session)
Create an "enhancement as proxy" instance for the given entity
-
injectInterceptor
LazyAttributeLoadingInterceptor injectInterceptor(java.lang.Object entity, java.lang.Object identifier, SharedSessionContractImplementor session) throws NotInstrumentedException
Build and inject an interceptor instance into the enhanced entity.- Parameters:
entity
- The entity into which built interceptor should be injectedidentifier
-session
- The session to which the entity instance belongs.- Returns:
- The built and injected interceptor
- Throws:
NotInstrumentedException
- Thrown ifisEnhancedForLazyLoading()
returnsfalse
-
injectInterceptor
void injectInterceptor(java.lang.Object entity, PersistentAttributeInterceptor interceptor, SharedSessionContractImplementor session)
-
injectEnhancedEntityAsProxyInterceptor
void injectEnhancedEntityAsProxyInterceptor(java.lang.Object entity, EntityKey entityKey, SharedSessionContractImplementor session)
-
extractInterceptor
LazyAttributeLoadingInterceptor extractInterceptor(java.lang.Object entity) throws NotInstrumentedException
Extract the field interceptor instance from the enhanced entity.- Parameters:
entity
- The entity from which to extract the interceptor- Returns:
- The extracted interceptor
- Throws:
NotInstrumentedException
- Thrown ifisEnhancedForLazyLoading()
returnsfalse
-
extractLazyInterceptor
BytecodeLazyAttributeInterceptor extractLazyInterceptor(java.lang.Object entity) throws NotInstrumentedException
- Throws:
NotInstrumentedException
-
hasUnFetchedAttributes
boolean hasUnFetchedAttributes(java.lang.Object entity)
-
isAttributeLoaded
boolean isAttributeLoaded(java.lang.Object entity, java.lang.String attributeName)
-
-