Top Description Methods
org.hibernate.bytecode.spi

public Interface BytecodeEnhancementMetadata

Known Direct Implementers
org.hibernate.tuple.entity.BytecodeEnhancementMetadataNonPojoImpl, org.hibernate.tuple.entity.BytecodeEnhancementMetadataPojoImpl
Imports
org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor, .LazyAttributeLoadingInterceptor, .LazyAttributesMetadata, org.hibernate.engine.spi.EntityKey, .PersistentAttributeInterceptable, .PersistentAttributeInterceptor, .SharedSessionContractImplementor

Encapsulates bytecode enhancement information about a particular entity.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public PersistentAttributeInterceptable
createEnhancedProxy(EntityKey keyToLoad, boolean addEmptyEntry, SharedSessionContractImplementor session)

Create an "enhancement as proxy" instance for the given entity

public LazyAttributeLoadingInterceptor

Returns:

The extracted interceptor
extractInterceptor
(Object
The entity from which to extract the interceptor
entity
)

Deprecated as a consequence of LazyAttributeLoadingInterceptor being deprecated.
Extract the field interceptor instance from the enhanced entity.
public BytecodeLazyAttributeInterceptor
extractLazyInterceptor(Object entity)

Deprecated as a consequence of BytecodeLazyAttributeInterceptor being deprecated.
public String

Returns:

The entity name
getEntityName
()

The name of the entity to which this metadata applies.

public LazyAttributesMetadata
public boolean
public void
public LazyAttributeLoadingInterceptor

Returns:

The built and injected interceptor
injectInterceptor
(Object
The entity into which built interceptor should be injected
entity
,
Object identifier, SharedSessionContractImplementor
The session to which the entity instance belongs.
session
)

Deprecated as a consequence of LazyAttributeLoadingInterceptor being deprecated.
Build and inject an interceptor instance into the enhanced entity.
public void
injectInterceptor(Object entity, PersistentAttributeInterceptor interceptor, SharedSessionContractImplementor session)

Deprecated as a consequence of PersistentAttributeInterceptor being deprecated.
public boolean
isAttributeLoaded(Object entity, String attributeName)

public boolean

Returns:

true indicates the entity class is enhanced for Hibernate use in lazy loading; false indicates it is not
isEnhancedForLazyLoading
()

Has the entity class been bytecode enhanced for lazy loading?

Method Detail

createEnhancedProxyback to summary
public PersistentAttributeInterceptable createEnhancedProxy(EntityKey keyToLoad, boolean addEmptyEntry, SharedSessionContractImplementor session)

Create an "enhancement as proxy" instance for the given entity

API Note

The `addEmptyEntry` parameter is used to avoid creation of `EntityEntry` instances when we do not need them. - mainly from StatelessSession

extractInterceptorback to summary
public LazyAttributeLoadingInterceptor extractInterceptor(Object entity) throws NotInstrumentedException

Deprecated

as a consequence of LazyAttributeLoadingInterceptor being deprecated. See corresponding docs for further information.

Extract the field interceptor instance from the enhanced entity.

Parameters
entity:Object

The entity from which to extract the interceptor

Returns:LazyAttributeLoadingInterceptor

The extracted interceptor

Exceptions
NotInstrumentedException:
Thrown if isEnhancedForLazyLoading() returns false
extractLazyInterceptorback to summary
public BytecodeLazyAttributeInterceptor extractLazyInterceptor(Object entity) throws NotInstrumentedException

Deprecated

as a consequence of BytecodeLazyAttributeInterceptor being deprecated. See corresponding docs for further information.

getEntityNameback to summary
public String getEntityName()

The name of the entity to which this metadata applies.

Returns:String

The entity name

getLazyAttributesMetadataback to summary
public LazyAttributesMetadata getLazyAttributesMetadata()
hasUnFetchedAttributesback to summary
public boolean hasUnFetchedAttributes(Object entity)
injectEnhancedEntityAsProxyInterceptorback to summary
public void injectEnhancedEntityAsProxyInterceptor(Object entity, EntityKey entityKey, SharedSessionContractImplementor session)
injectInterceptorback to summary
public LazyAttributeLoadingInterceptor injectInterceptor(Object entity, Object identifier, SharedSessionContractImplementor session) throws NotInstrumentedException

Deprecated

as a consequence of LazyAttributeLoadingInterceptor being deprecated. See corresponding docs for further information.

Build and inject an interceptor instance into the enhanced entity.

Parameters
entity:Object

The entity into which built interceptor should be injected

session:SharedSessionContractImplementor

The session to which the entity instance belongs.

Returns:LazyAttributeLoadingInterceptor

The built and injected interceptor

Exceptions
NotInstrumentedException:
Thrown if isEnhancedForLazyLoading() returns false
injectInterceptorback to summary
public void injectInterceptor(Object entity, PersistentAttributeInterceptor interceptor, SharedSessionContractImplementor session)

Deprecated

as a consequence of PersistentAttributeInterceptor being deprecated. See corresponding docs for further information.

isAttributeLoadedback to summary
public boolean isAttributeLoaded(Object entity, String attributeName)
isEnhancedForLazyLoadingback to summary
public boolean isEnhancedForLazyLoading()

Has the entity class been bytecode enhanced for lazy loading?

Returns:boolean

true indicates the entity class is enhanced for Hibernate use in lazy loading; false indicates it is not