Package org.hibernate.bytecode.internal
Class BytecodeEnhancementMetadataPojoImpl
java.lang.Object
org.hibernate.bytecode.internal.BytecodeEnhancementMetadataPojoImpl
- All Implemented Interfaces:
BytecodeEnhancementMetadata
public final class BytecodeEnhancementMetadataPojoImpl
extends Object
implements BytecodeEnhancementMetadata
BytecodeEnhancementMetadata implementation for
POJO
models-
Method Summary
Modifier and TypeMethodDescriptioncreateEnhancedProxy
(EntityKey entityKey, boolean addEmptyEntry, SharedSessionContractImplementor session) Create an "enhancement as proxy" instance for the given entity@Nullable LazyAttributeLoadingInterceptor
extractInterceptor
(Object entity) Extract the field interceptor instance from the enhanced entity.@Nullable BytecodeLazyAttributeInterceptor
extractLazyInterceptor
(Object entity) static BytecodeEnhancementMetadata
from
(PersistentClass persistentClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean collectionsInDefaultFetchGroupEnabled, Metadata metadata) Static constructorThe name of the entity to which this metadata applies.boolean
hasUnFetchedAttributes
(Object entity) void
injectEnhancedEntityAsProxyInterceptor
(Object entity, EntityKey entityKey, SharedSessionContractImplementor session) injectInterceptor
(Object entity, Object identifier, SharedSessionContractImplementor session) Build and inject an interceptor instance into the enhanced entity.void
injectInterceptor
(Object entity, PersistentAttributeInterceptor interceptor, SharedSessionContractImplementor session) boolean
isAttributeLoaded
(Object entity, String attributeName) boolean
Has the entity class been bytecode enhanced for lazy loading?
-
Method Details
-
from
public static BytecodeEnhancementMetadata from(PersistentClass persistentClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean collectionsInDefaultFetchGroupEnabled, Metadata metadata) Static constructor -
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
- Specified by:
getLazyAttributesMetadata
in interfaceBytecodeEnhancementMetadata
-
hasUnFetchedAttributes
- Specified by:
hasUnFetchedAttributes
in interfaceBytecodeEnhancementMetadata
-
isAttributeLoaded
- Specified by:
isAttributeLoaded
in interfaceBytecodeEnhancementMetadata
-
extractInterceptor
public @Nullable LazyAttributeLoadingInterceptor extractInterceptor(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 @Nullable BytecodeLazyAttributeInterceptor extractLazyInterceptor(Object entity) throws NotInstrumentedException - Specified by:
extractLazyInterceptor
in interfaceBytecodeEnhancementMetadata
- Throws:
NotInstrumentedException
-