FileDocCategorySizeDatePackage
FieldInterceptorImpl.javaAPI DocHibernate 3.2.54917Thu Aug 03 15:35:26 BST 2006org.hibernate.intercept.javassist

FieldInterceptorImpl

public final class FieldInterceptorImpl extends org.hibernate.intercept.AbstractFieldInterceptor implements org.hibernate.bytecode.javassist.FieldHandler, Serializable
A field-level interceptor that initializes lazily fetched properties. This interceptor can be attached to classes instrumented by Javassist. Note that this implementation assumes that the instance variable name is the same as the name of the persistent property that must be loaded.

Note: most of the interesting functionality here is farmed off to the super-class. The stuff here mainly acts as an adapter to the Javassist-specific functionality, routing interception through the super-class's intercept() method
author
Steve Ebersole

Fields Summary
Constructors Summary
FieldInterceptorImpl(org.hibernate.engine.SessionImplementor session, Set uninitializedFields, String entityName)
Package-protected constructor.

param
session
param
uninitializedFields
param
entityName

		super( session, uninitializedFields, entityName );
	
Methods Summary
public booleanreadBoolean(java.lang.Object target, java.lang.String name, boolean oldValue)

		return ( ( Boolean ) intercept( target, name, oldValue  ? Boolean.TRUE : Boolean.FALSE ) )
				.booleanValue();
	
public bytereadByte(java.lang.Object target, java.lang.String name, byte oldValue)

		return ( ( Byte ) intercept( target, name, new Byte( oldValue ) ) ).byteValue();
	
public charreadChar(java.lang.Object target, java.lang.String name, char oldValue)

		return ( ( Character ) intercept( target, name, new Character( oldValue ) ) )
				.charValue();
	
public doublereadDouble(java.lang.Object target, java.lang.String name, double oldValue)

		return ( ( Double ) intercept( target, name, new Double( oldValue ) ) )
				.doubleValue();
	
public floatreadFloat(java.lang.Object target, java.lang.String name, float oldValue)

		return ( ( Float ) intercept( target, name, new Float( oldValue ) ) )
				.floatValue();
	
public intreadInt(java.lang.Object target, java.lang.String name, int oldValue)

		return ( ( Integer ) intercept( target, name, new Integer( oldValue ) ) )
				.intValue();
	
public longreadLong(java.lang.Object target, java.lang.String name, long oldValue)

		return ( ( Long ) intercept( target, name, new Long( oldValue ) ) ).longValue();
	
public java.lang.ObjectreadObject(java.lang.Object target, java.lang.String name, java.lang.Object oldValue)

		Object value = intercept( target, name, oldValue );
		if (value instanceof HibernateProxy) {
			LazyInitializer li = ( (HibernateProxy) value ).getHibernateLazyInitializer();
			if ( li.isUnwrap() ) {
				value = li.getImplementation();
			}
		}
		return value;
	
public shortreadShort(java.lang.Object target, java.lang.String name, short oldValue)

		return ( ( Short ) intercept( target, name, new Short( oldValue ) ) )
				.shortValue();
	
public java.lang.StringtoString()

		return "FieldInterceptorImpl(" +
			"entityName=" + getEntityName() +
			",dirty=" + isDirty() +
			",uninitializedFields=" + getUninitializedFields() +
			')";
	
public booleanwriteBoolean(java.lang.Object target, java.lang.String name, boolean oldValue, boolean newValue)

		dirty();
		intercept( target, name, oldValue ? Boolean.TRUE : Boolean.FALSE );
		return newValue;
	
public bytewriteByte(java.lang.Object target, java.lang.String name, byte oldValue, byte newValue)

		dirty();
		intercept( target, name, new Byte( oldValue ) );
		return newValue;
	
public charwriteChar(java.lang.Object target, java.lang.String name, char oldValue, char newValue)

		dirty();
		intercept( target, name, new Character( oldValue ) );
		return newValue;
	
public doublewriteDouble(java.lang.Object target, java.lang.String name, double oldValue, double newValue)

		dirty();
		intercept( target, name, new Double( oldValue ) );
		return newValue;
	
public floatwriteFloat(java.lang.Object target, java.lang.String name, float oldValue, float newValue)

		dirty();
		intercept( target, name, new Float( oldValue ) );
		return newValue;
	
public intwriteInt(java.lang.Object target, java.lang.String name, int oldValue, int newValue)

		dirty();
		intercept( target, name, new Integer( oldValue ) );
		return newValue;
	
public longwriteLong(java.lang.Object target, java.lang.String name, long oldValue, long newValue)

		dirty();
		intercept( target, name, new Long( oldValue ) );
		return newValue;
	
public java.lang.ObjectwriteObject(java.lang.Object target, java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)

		dirty();
		intercept( target, name, oldValue );
		return newValue;
	
public shortwriteShort(java.lang.Object target, java.lang.String name, short oldValue, short newValue)

		dirty();
		intercept( target, name, new Short( oldValue ) );
		return newValue;