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
Modifier and TypeMethodDescriptioncreateEnhancedProxy(EntityKey keyToLoad, boolean addEmptyEntry, SharedSessionContractImplementor session) Create an "enhancement as proxy" instance for the given entity@Nullable LazyAttributeLoadingInterceptorextractInterceptor(Object entity) Extract the field interceptor instance from the enhanced entity.@Nullable BytecodeLazyAttributeInterceptorextractLazyInterceptor(Object entity) The name of the entity to which this metadata applies.booleanhasUnFetchedAttributes(Object entity) voidinjectEnhancedEntityAsProxyInterceptor(Object entity, EntityKey entityKey, SharedSessionContractImplementor session) injectInterceptor(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) booleanHas the entity class been bytecode enhanced for lazy loading?
-
Method Details
-
getEntityName
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:
trueindicates the entity class is enhanced for Hibernate use in lazy loading;falseindicates it is not
-
getLazyAttributesMetadata
LazyAttributesMetadata getLazyAttributesMetadata() -
extractInterceptor
@Nullable LazyAttributeLoadingInterceptor extractInterceptor(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
@Nullable BytecodeLazyAttributeInterceptor extractLazyInterceptor(Object entity) throws NotInstrumentedException - Throws:
NotInstrumentedException
-
hasUnFetchedAttributes
-
isAttributeLoaded
-