FieldInterceptorImplpublic final class FieldInterceptorImpl extends org.hibernate.intercept.AbstractFieldInterceptor implements org.hibernate.bytecode.javassist.FieldHandler, SerializableA 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 |
Methods Summary |
---|
public boolean | readBoolean(java.lang.Object target, java.lang.String name, boolean oldValue)
return ( ( Boolean ) intercept( target, name, oldValue ? Boolean.TRUE : Boolean.FALSE ) )
.booleanValue();
| public byte | readByte(java.lang.Object target, java.lang.String name, byte oldValue)
return ( ( Byte ) intercept( target, name, new Byte( oldValue ) ) ).byteValue();
| public char | readChar(java.lang.Object target, java.lang.String name, char oldValue)
return ( ( Character ) intercept( target, name, new Character( oldValue ) ) )
.charValue();
| public double | readDouble(java.lang.Object target, java.lang.String name, double oldValue)
return ( ( Double ) intercept( target, name, new Double( oldValue ) ) )
.doubleValue();
| public float | readFloat(java.lang.Object target, java.lang.String name, float oldValue)
return ( ( Float ) intercept( target, name, new Float( oldValue ) ) )
.floatValue();
| public int | readInt(java.lang.Object target, java.lang.String name, int oldValue)
return ( ( Integer ) intercept( target, name, new Integer( oldValue ) ) )
.intValue();
| public long | readLong(java.lang.Object target, java.lang.String name, long oldValue)
return ( ( Long ) intercept( target, name, new Long( oldValue ) ) ).longValue();
| public java.lang.Object | readObject(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 short | readShort(java.lang.Object target, java.lang.String name, short oldValue)
return ( ( Short ) intercept( target, name, new Short( oldValue ) ) )
.shortValue();
| public java.lang.String | toString()
return "FieldInterceptorImpl(" +
"entityName=" + getEntityName() +
",dirty=" + isDirty() +
",uninitializedFields=" + getUninitializedFields() +
')";
| public boolean | writeBoolean(java.lang.Object target, java.lang.String name, boolean oldValue, boolean newValue)
dirty();
intercept( target, name, oldValue ? Boolean.TRUE : Boolean.FALSE );
return newValue;
| public byte | writeByte(java.lang.Object target, java.lang.String name, byte oldValue, byte newValue)
dirty();
intercept( target, name, new Byte( oldValue ) );
return newValue;
| public char | writeChar(java.lang.Object target, java.lang.String name, char oldValue, char newValue)
dirty();
intercept( target, name, new Character( oldValue ) );
return newValue;
| public double | writeDouble(java.lang.Object target, java.lang.String name, double oldValue, double newValue)
dirty();
intercept( target, name, new Double( oldValue ) );
return newValue;
| public float | writeFloat(java.lang.Object target, java.lang.String name, float oldValue, float newValue)
dirty();
intercept( target, name, new Float( oldValue ) );
return newValue;
| public int | writeInt(java.lang.Object target, java.lang.String name, int oldValue, int newValue)
dirty();
intercept( target, name, new Integer( oldValue ) );
return newValue;
| public long | writeLong(java.lang.Object target, java.lang.String name, long oldValue, long newValue)
dirty();
intercept( target, name, new Long( oldValue ) );
return newValue;
| public java.lang.Object | writeObject(java.lang.Object target, java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
dirty();
intercept( target, name, oldValue );
return newValue;
| public short | writeShort(java.lang.Object target, java.lang.String name, short oldValue, short newValue)
dirty();
intercept( target, name, new Short( oldValue ) );
return newValue;
|
|