Top Description Fields Constructors Methods
org.hibernate.bytecode.enhance.spi.interceptor

public Class LazyAttributeLoadingInterceptor

extends AbstractLazyLoadInterceptor
Class Inheritance
Imports
java.io.Serializable, java.util.Collection, .Collections, .HashSet, .Set, org.hibernate.LockMode, org.hibernate.bytecode.enhance.spi.CollectionTracker, .LazyPropertyInitializer, org.hibernate.collection.spi.PersistentCollection, org.hibernate.engine.internal.ManagedTypeHelper, org.hibernate.engine.spi.SelfDirtinessTracker, .SharedSessionContractImplementor, .Status, org.hibernate.persister.entity.EntityPersister

Deprecated

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

Interceptor that loads attributes lazily
Authors
Luis Barreiro, Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final Object
private Set<String>
private final Set<String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public Object
fetchAttribute(final Object target, final String attributeName)

Fetches the lazy attribute.

public Object
getIdentifier()

Implements org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor.getIdentifier.

The id of the entity instance this interceptor is associated with
public Set<String>
protected Object
handleRead(Object target, String attributeName, Object value)

Implements abstract org.hibernate.bytecode.enhance.spi.interceptor.AbstractInterceptor.handleRead.

Handle the case of reading an attribute.
protected Object
handleWrite(Object target, String attributeName, Object oldValue, Object newValue)

Implements abstract org.hibernate.bytecode.enhance.spi.interceptor.AbstractInterceptor.handleWrite.

Handle the case of writing an attribute.
public boolean
public boolean
private boolean
private boolean
protected Object
loadAttribute(final Object target, final String attributeName)

private void
takeCollectionSizeSnapshot(Object target, String fieldName, Object value)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

identifierback to summary
private final Object identifier
initializedLazyFieldsback to summary
private Set<String> initializedLazyFields
lazyFieldsback to summary
private final Set<String> lazyFields

Constructor Detail

LazyAttributeLoadingInterceptorback to summary
public LazyAttributeLoadingInterceptor(String entityName, Object identifier, Set<String> lazyFields, SharedSessionContractImplementor session)

Method Detail

attributeInitializedback to summary
public void attributeInitialized(String name)

Overrides default org.hibernate.engine.spi.PersistentAttributeInterceptor.attributeInitialized.

Implements org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor.attributeInitialized.

Doc from org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor.attributeInitialized.

Callback from the enhanced class that an attribute has been read or written

Annotations
@Override
fetchAttributeback to summary
public Object fetchAttribute(final Object target, final String attributeName)

Fetches the lazy attribute. The attribute does not get associated with the entity. (To be used by hibernate methods)

getIdentifierback to summary
public Object getIdentifier()

Implements org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor.getIdentifier.

Doc from org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor.getIdentifier.

The id of the entity instance this interceptor is associated with

Annotations
@Override
getInitializedLazyAttributeNamesback to summary
public Set<String> getInitializedLazyAttributeNames()

Overrides default org.hibernate.engine.spi.PersistentAttributeInterceptor.getInitializedLazyAttributeNames.

Implements org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor.getInitializedLazyAttributeNames.

Doc from org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor.getInitializedLazyAttributeNames.

The names of all lazy attributes which have been initialized

Annotations
@Override
handleReadback to summary
protected Object handleRead(Object target, String attributeName, Object value)

Implements abstract org.hibernate.bytecode.enhance.spi.interceptor.AbstractInterceptor.handleRead.

Doc from org.hibernate.bytecode.enhance.spi.interceptor.AbstractInterceptor.handleRead.

Handle the case of reading an attribute. The result is what is returned to the caller

Annotations
@Override
handleWriteback to summary
protected Object handleWrite(Object target, String attributeName, Object oldValue, Object newValue)

Implements abstract org.hibernate.bytecode.enhance.spi.interceptor.AbstractInterceptor.handleWrite.

Doc from org.hibernate.bytecode.enhance.spi.interceptor.AbstractInterceptor.handleWrite.

Handle the case of writing an attribute. The result is what is set as the entity state

Annotations
@Override
hasAnyUninitializedAttributesback to summary
public boolean hasAnyUninitializedAttributes()

Implements org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor.hasAnyUninitializedAttributes.

isAttributeLoadedback to summary
public boolean isAttributeLoaded(String fieldName)

Overrides default org.hibernate.engine.spi.PersistentAttributeInterceptor.isAttributeLoaded.

Implements org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor.isAttributeLoaded.

Doc from org.hibernate.engine.spi.PersistentAttributeInterceptor.isAttributeLoaded.

Callback from the enhanced class that an attribute has been loaded

Returns:boolean

true id the attribute is loaded false otherwise

isInitializedLazyFieldback to summary
private boolean isInitializedLazyField(String fieldName)
isLazyAttributeback to summary
private boolean isLazyAttribute(String fieldName)
loadAttributeback to summary
protected Object loadAttribute(final Object target, final String attributeName)
takeCollectionSizeSnapshotback to summary
private void takeCollectionSizeSnapshot(Object target, String fieldName, Object value)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override