Package org.hibernate.bytecode.internal
Class BytecodeEnhancementMetadataPojoImpl
java.lang.Object
org.hibernate.bytecode.internal.BytecodeEnhancementMetadataPojoImpl
- All Implemented Interfaces:
BytecodeEnhancementMetadata
public class BytecodeEnhancementMetadataPojoImpl
extends Object
implements BytecodeEnhancementMetadata
BytecodeEnhancementMetadata implementation for
POJO models-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBytecodeEnhancementMetadataPojoImpl(String entityName, Class<?> entityClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean enhancedForLazyLoading, LazyAttributesMetadata lazyAttributesMetadata) -
Method Summary
Modifier and TypeMethodDescriptioncreateEnhancedProxy(EntityKey entityKey, 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) from(PersistentClass persistentClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean collectionsInDefaultFetchGroupEnabled, Metadata metadata) Static constructorClass<?> 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?
-
Constructor Details
-
BytecodeEnhancementMetadataPojoImpl
protected BytecodeEnhancementMetadataPojoImpl(String entityName, Class<?> entityClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean enhancedForLazyLoading, LazyAttributesMetadata lazyAttributesMetadata)
-
-
Method Details
-
from
public static BytecodeEnhancementMetadataPojoImpl from(PersistentClass persistentClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean collectionsInDefaultFetchGroupEnabled, Metadata metadata) Static constructor -
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
- Specified by:
getLazyAttributesMetadatain interfaceBytecodeEnhancementMetadata
-
hasUnFetchedAttributes
- Specified by:
hasUnFetchedAttributesin interfaceBytecodeEnhancementMetadata
-
isAttributeLoaded
- Specified by:
isAttributeLoadedin interfaceBytecodeEnhancementMetadata
-
extractInterceptor
public @Nullable 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
-
extractLazyInterceptor
public @Nullable BytecodeLazyAttributeInterceptor extractLazyInterceptor(Object entity) throws NotInstrumentedException - Specified by:
extractLazyInterceptorin interfaceBytecodeEnhancementMetadata- Throws:
NotInstrumentedException
-
getEntityClass
-
getLazyAttributeLoadingInterceptorState
-