public final class BytecodeEnhancementMetadataPojoImpl extends Object implements BytecodeEnhancementMetadata
Modifier | Constructor and Description |
---|---|
protected |
BytecodeEnhancementMetadataPojoImpl(String entityName,
Class entityClass,
Set<String> identifierAttributeNames,
CompositeType nonAggregatedCidMapper,
boolean enhancedForLazyLoading,
LazyAttributesMetadata lazyAttributesMetadata) |
Modifier and Type | Method and Description |
---|---|
PersistentAttributeInterceptable |
createEnhancedProxy(EntityKey entityKey,
boolean addEmptyEntry,
SharedSessionContractImplementor session)
Create an "enhancement as proxy" instance for the given entity
|
LazyAttributeLoadingInterceptor |
extractInterceptor(Object entity)
Extract the field interceptor instance from the enhanced entity.
|
BytecodeLazyAttributeInterceptor |
extractLazyInterceptor(Object entity) |
static BytecodeEnhancementMetadata |
from(PersistentClass persistentClass,
Set<String> identifierAttributeNames,
CompositeType nonAggregatedCidMapper,
boolean allowEnhancementAsProxy)
Static constructor
|
String |
getEntityName()
The name of the entity to which this metadata applies.
|
LazyAttributesMetadata |
getLazyAttributesMetadata() |
boolean |
hasUnFetchedAttributes(Object entity) |
void |
injectEnhancedEntityAsProxyInterceptor(Object entity,
EntityKey entityKey,
SharedSessionContractImplementor session) |
LazyAttributeLoadingInterceptor |
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 |
isEnhancedForLazyLoading()
Has the entity class been bytecode enhanced for lazy loading?
|
protected BytecodeEnhancementMetadataPojoImpl(String entityName, Class entityClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean enhancedForLazyLoading, LazyAttributesMetadata lazyAttributesMetadata)
public static BytecodeEnhancementMetadata from(PersistentClass persistentClass, Set<String> identifierAttributeNames, CompositeType nonAggregatedCidMapper, boolean allowEnhancementAsProxy)
public String getEntityName()
BytecodeEnhancementMetadata
getEntityName
in interface BytecodeEnhancementMetadata
public boolean isEnhancedForLazyLoading()
BytecodeEnhancementMetadata
isEnhancedForLazyLoading
in interface BytecodeEnhancementMetadata
true
indicates the entity class is enhanced for Hibernate use
in lazy loading; false
indicates it is notpublic LazyAttributesMetadata getLazyAttributesMetadata()
getLazyAttributesMetadata
in interface BytecodeEnhancementMetadata
public boolean hasUnFetchedAttributes(Object entity)
hasUnFetchedAttributes
in interface BytecodeEnhancementMetadata
public boolean isAttributeLoaded(Object entity, String attributeName)
isAttributeLoaded
in interface BytecodeEnhancementMetadata
public LazyAttributeLoadingInterceptor extractInterceptor(Object entity) throws NotInstrumentedException
BytecodeEnhancementMetadata
extractInterceptor
in interface BytecodeEnhancementMetadata
entity
- The entity from which to extract the interceptorNotInstrumentedException
- Thrown if BytecodeEnhancementMetadata.isEnhancedForLazyLoading()
returns false
public PersistentAttributeInterceptable createEnhancedProxy(EntityKey entityKey, boolean addEmptyEntry, SharedSessionContractImplementor session)
BytecodeEnhancementMetadata
createEnhancedProxy
in interface BytecodeEnhancementMetadata
public LazyAttributeLoadingInterceptor injectInterceptor(Object entity, Object identifier, SharedSessionContractImplementor session)
BytecodeEnhancementMetadata
injectInterceptor
in interface BytecodeEnhancementMetadata
entity
- The entity into which built interceptor should be injectedsession
- The session to which the entity instance belongs.public void injectEnhancedEntityAsProxyInterceptor(Object entity, EntityKey entityKey, SharedSessionContractImplementor session)
injectEnhancedEntityAsProxyInterceptor
in interface BytecodeEnhancementMetadata
public void injectInterceptor(Object entity, PersistentAttributeInterceptor interceptor, SharedSessionContractImplementor session)
injectInterceptor
in interface BytecodeEnhancementMetadata
public BytecodeLazyAttributeInterceptor extractLazyInterceptor(Object entity) throws NotInstrumentedException
extractLazyInterceptor
in interface BytecodeEnhancementMetadata
NotInstrumentedException
Copyright © 2019 JBoss by Red Hat. All rights reserved.