Class AbstractInterceptor
- java.lang.Object
-
- org.hibernate.bytecode.enhance.spi.interceptor.AbstractInterceptor
-
- All Implemented Interfaces:
SessionAssociableInterceptor
,LazyPropertyInitializer.InterceptorImplementor
,PersistentAttributeInterceptor
- Direct Known Subclasses:
AbstractLazyLoadInterceptor
public abstract class AbstractInterceptor extends Object implements SessionAssociableInterceptor
-
-
Constructor Summary
Constructors Constructor Description AbstractInterceptor(String entityName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
allowLoadOutsideTransaction()
String
getEntityName()
SharedSessionContractImplementor
getLinkedSession()
String
getSessionFactoryUuid()
protected abstract Object
handleRead(Object target, String attributeName, Object value)
Handle the case of reading an attribute.protected abstract Object
handleWrite(Object target, String attributeName, Object oldValue, Object newValue)
Handle the case of writing an attribute.boolean
readBoolean(Object obj, String name, boolean oldValue)
byte
readByte(Object obj, String name, byte oldValue)
char
readChar(Object obj, String name, char oldValue)
double
readDouble(Object obj, String name, double oldValue)
float
readFloat(Object obj, String name, float oldValue)
int
readInt(Object obj, String name, int oldValue)
long
readLong(Object obj, String name, long oldValue)
Object
readObject(Object obj, String name, Object oldValue)
short
readShort(Object obj, String name, short oldValue)
void
setSession(SharedSessionContractImplementor session)
void
unsetSession()
boolean
writeBoolean(Object obj, String name, boolean oldValue, boolean newValue)
byte
writeByte(Object obj, String name, byte oldValue, byte newValue)
char
writeChar(Object obj, String name, char oldValue, char newValue)
double
writeDouble(Object obj, String name, double oldValue, double newValue)
float
writeFloat(Object obj, String name, float oldValue, float newValue)
int
writeInt(Object obj, String name, int oldValue, int newValue)
long
writeLong(Object obj, String name, long oldValue, long newValue)
Object
writeObject(Object obj, String name, Object oldValue, Object newValue)
short
writeShort(Object obj, String name, short oldValue, short newValue)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.engine.spi.PersistentAttributeInterceptor
attributeInitialized, getInitializedLazyAttributeNames, isAttributeLoaded
-
-
-
-
Constructor Detail
-
AbstractInterceptor
public AbstractInterceptor(String entityName)
-
-
Method Detail
-
getEntityName
public String getEntityName()
-
getLinkedSession
public SharedSessionContractImplementor getLinkedSession()
- Specified by:
getLinkedSession
in interfaceSessionAssociableInterceptor
-
setSession
public void setSession(SharedSessionContractImplementor session)
- Specified by:
setSession
in interfaceSessionAssociableInterceptor
-
unsetSession
public void unsetSession()
- Specified by:
unsetSession
in interfaceSessionAssociableInterceptor
-
allowLoadOutsideTransaction
public boolean allowLoadOutsideTransaction()
- Specified by:
allowLoadOutsideTransaction
in interfaceSessionAssociableInterceptor
-
getSessionFactoryUuid
public String getSessionFactoryUuid()
- Specified by:
getSessionFactoryUuid
in interfaceSessionAssociableInterceptor
-
handleRead
protected abstract Object handleRead(Object target, String attributeName, Object value)
Handle the case of reading an attribute. The result is what is returned to the caller
-
handleWrite
protected abstract Object handleWrite(Object target, String attributeName, Object oldValue, Object newValue)
Handle the case of writing an attribute. The result is what is set as the entity state
-
readBoolean
public boolean readBoolean(Object obj, String name, boolean oldValue)
- Specified by:
readBoolean
in interfacePersistentAttributeInterceptor
-
writeBoolean
public boolean writeBoolean(Object obj, String name, boolean oldValue, boolean newValue)
- Specified by:
writeBoolean
in interfacePersistentAttributeInterceptor
-
readByte
public byte readByte(Object obj, String name, byte oldValue)
- Specified by:
readByte
in interfacePersistentAttributeInterceptor
-
writeByte
public byte writeByte(Object obj, String name, byte oldValue, byte newValue)
- Specified by:
writeByte
in interfacePersistentAttributeInterceptor
-
readChar
public char readChar(Object obj, String name, char oldValue)
- Specified by:
readChar
in interfacePersistentAttributeInterceptor
-
writeChar
public char writeChar(Object obj, String name, char oldValue, char newValue)
- Specified by:
writeChar
in interfacePersistentAttributeInterceptor
-
readShort
public short readShort(Object obj, String name, short oldValue)
- Specified by:
readShort
in interfacePersistentAttributeInterceptor
-
writeShort
public short writeShort(Object obj, String name, short oldValue, short newValue)
- Specified by:
writeShort
in interfacePersistentAttributeInterceptor
-
readInt
public int readInt(Object obj, String name, int oldValue)
- Specified by:
readInt
in interfacePersistentAttributeInterceptor
-
writeInt
public int writeInt(Object obj, String name, int oldValue, int newValue)
- Specified by:
writeInt
in interfacePersistentAttributeInterceptor
-
readFloat
public float readFloat(Object obj, String name, float oldValue)
- Specified by:
readFloat
in interfacePersistentAttributeInterceptor
-
writeFloat
public float writeFloat(Object obj, String name, float oldValue, float newValue)
- Specified by:
writeFloat
in interfacePersistentAttributeInterceptor
-
readDouble
public double readDouble(Object obj, String name, double oldValue)
- Specified by:
readDouble
in interfacePersistentAttributeInterceptor
-
writeDouble
public double writeDouble(Object obj, String name, double oldValue, double newValue)
- Specified by:
writeDouble
in interfacePersistentAttributeInterceptor
-
readLong
public long readLong(Object obj, String name, long oldValue)
- Specified by:
readLong
in interfacePersistentAttributeInterceptor
-
writeLong
public long writeLong(Object obj, String name, long oldValue, long newValue)
- Specified by:
writeLong
in interfacePersistentAttributeInterceptor
-
readObject
public Object readObject(Object obj, String name, Object oldValue)
- Specified by:
readObject
in interfacePersistentAttributeInterceptor
-
writeObject
public Object writeObject(Object obj, String name, Object oldValue, Object newValue)
- Specified by:
writeObject
in interfacePersistentAttributeInterceptor
-
-