private final class RecordBuffer.Handler
extends java.lang.Object
implements java.lang.reflect.InvocationHandler
buffer()
method which
permits classes in this package to retrieve the record buffer instance
itself from the proxy. The former methods are meant for use by client
code, while the latter allows persistence support classes, such as
query objects, to access the buffer for implementation and housekeeping
purposes.Modifier and Type | Field and Description |
---|---|
private ValidationException |
deferredValidationError
Exception thrown during validation of no-undo temp-tables, which must be deferred
|
private org.hibernate.Session |
session
Hibernate session
|
Constructor and Description |
---|
Handler()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
detectChange(java.lang.Integer index,
java.lang.String property,
java.lang.reflect.Method getter,
BaseDataType newVal,
boolean[] changeCodes)
Process a setter method about to be invoked by the invocation handler.
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
This method acts as an interceptor which is called every time a
method of the proxy object is invoked.
|
private org.hibernate.Session session
private ValidationException deferredValidationError
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
Certain methods are reserved, and are not forwarded to the
backing DMO; instead, they are invoked on the enclosing instance of
the RecordBuffer
class. These are any methods declared
by the BufferReference
interface or by the
Object
class.
invoke
in interface java.lang.reflect.InvocationHandler
proxy
- Proxy object upon which the intercepted method is invoked.method
- Method to be invoked through reflection.args
- Arguments, if any, to method
.java.lang.Throwable
- if an exception/error occurs upon the invocation target,
or if any problem occurs during pre- or post-processing.private void detectChange(java.lang.Integer index, java.lang.String property, java.lang.reflect.Method getter, BaseDataType newVal, boolean[] changeCodes) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, PersistenceException, ValidationException
ChangeBroker
.
This method handles both indexed and non-indexed properties. The index
parameter must be non-null
and non-negative for indexed properties, and
should be null
for non-indexed properties.
index
- Non-negative, zero-based index value to be used for an indexed property.
Should be null
for a non-indexed property.property
- Name of property affected by the setter invocation.getter
- Getter method.newVal
- New value to be set into the property.changeCodes
- Array of boolean values which are updated by this method to provide feedback to
the caller as to the change which will occur as a result of the setter method
invocation:
changeCodes[0]
: indicates that either
the new value being set is different than the
existing property value, or that the boolean at this
position in the array was already true
at the invocation of this method.
changeCodes[1]
: indicates that either
this method determined that a change occurred which
must be processed immediately by the record buffer
and reported to the change broker, or that the
boolean at this position in the array was already
true
at the invocation of this method.
changeCodes[2]
: indicates that change
was prevalidated and no further validation is
necessary for the current (transient) record before
it can be flushed to the database.
true
, such
that any change detected within the loop is properly detected by the caller
at the loop's end.java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
PersistenceException
ValidationException