wt.fc.batch
Class AbstractBatchSpec

java.lang.Object
  extended bywt.fc.batch.AbstractBatchSpec
All Implemented Interfaces:
Externalizable, Serializable
Direct Known Subclasses:
DeleteBatchSpec, UpdateBatchSpec

public abstract class AbstractBatchSpec
extends Object
implements Externalizable

This class specifies the contract for processing multiple row update and delete operations.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  boolean chunkingEnabled
           
private static String CLASSNAME
           
static boolean DEBUG
           
static long EXTERNALIZATION_VERSION_UID
           
private static String ID_UPDATE_COUNT_SELECT_LIST
           
private static DebugWriter LOG
           
private static String OID_COLUMN_ALIAS
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  ClassTableExpression target
           
private static String UPDATE_COUNT_COLUMN_ALIAS
           
private  WhereExpression where
           
 
Constructor Summary
AbstractBatchSpec()
          This constructor initializes the instance.
AbstractBatchSpec(ClassTableExpression a_target, WhereExpression a_where)
          This constructor initializes the instance.
 
Method Summary
 void appendWhere(WhereExpression a_where, LogicalOperator a_logicalOperator)
          Appends the WhereExpression to the WHERE clause.
 void appendWhere(WTCollection a_objects, boolean a_checkUpdateCount, LogicalOperator a_logicalOperator)
          This method appends a WhereEpression to include the specified objects by object ID.
private static QuerySpec buildIdUpdateCountQuerySpec(Class a_targetClass, WTCollection a_targetObjects, boolean a_useColumnList)
           
private static SubSelectExpression buildIdUpdateCountSubSelectExpression(WTCollection a_targetObjects, boolean a_useColumnList)
           
private static ArrayTableExpression buildIdUpdateCountTableExpression(WTCollection a_targetObjects, long[] a_idValues)
           
private static WhereExpression buildIdUpdateCountWhereExpression(Class a_targetClass, Persistable a_targetObject)
           
 ClassTableExpression getTarget()
          Gets the value of the attribute: target; The target of the operation.
 WhereExpression getWhere()
          Gets the value of the attribute: where; Criteria to use for the operation.
 boolean isChunkingEnabled()
          Gets the value of the attribute: chunkingEnabled.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(AbstractBatchSpec thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setChunkingEnabled(boolean a_ChunkingEnabled)
          Sets the value of the attribute: chunkingEnabled.
 void setTarget(ClassTableExpression a_Target)
          Sets the value of the attribute: target; The target of the operation.
 void setWhere(WhereExpression a_Where)
          Sets the value of the attribute: where; Criteria to use for the operation.
private  void targetValidate(ClassTableExpression a_Target)
           
private  void validate(WhereExpression a_where)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

target

private ClassTableExpression target

where

private WhereExpression where

chunkingEnabled

private boolean chunkingEnabled

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

DEBUG

public static final boolean DEBUG

LOG

private static final DebugWriter LOG

OID_COLUMN_ALIAS

private static final String OID_COLUMN_ALIAS

UPDATE_COUNT_COLUMN_ALIAS

private static final String UPDATE_COUNT_COLUMN_ALIAS

ID_UPDATE_COUNT_SELECT_LIST

private static final String ID_UPDATE_COUNT_SELECT_LIST
Constructor Detail

AbstractBatchSpec

public AbstractBatchSpec()
This constructor initializes the instance.

Supported API: false


AbstractBatchSpec

public AbstractBatchSpec(ClassTableExpression a_target,
                         WhereExpression a_where)
                  throws WTPropertyVetoException
This constructor initializes the instance.

Supported API: false

Parameters:
a_target - Target of the operation.
a_where - Criteria to use for the operation.
Throws:
WTPropertyVetoException
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(AbstractBatchSpec thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getTarget

public ClassTableExpression getTarget()
Gets the value of the attribute: target; The target of the operation.

Supported API: true

Returns:
ClassTableExpression

setTarget

public void setTarget(ClassTableExpression a_Target)
               throws WTPropertyVetoException
Sets the value of the attribute: target; The target of the operation.

Supported API: true

Parameters:
a_Target -
Throws:
WTPropertyVetoException

targetValidate

private void targetValidate(ClassTableExpression a_Target)
                     throws WTPropertyVetoException
Parameters:
a_Target -
Throws:
WTPropertyVetoException

getWhere

public WhereExpression getWhere()
Gets the value of the attribute: where; Criteria to use for the operation.

Supported API: true

Returns:
WhereExpression

setWhere

public void setWhere(WhereExpression a_Where)
              throws WTPropertyVetoException
Sets the value of the attribute: where; Criteria to use for the operation.

Supported API: true

Parameters:
a_Where -
Throws:
WTPropertyVetoException

isChunkingEnabled

public boolean isChunkingEnabled()
Gets the value of the attribute: chunkingEnabled.

Supported API: false

Returns:
boolean

setChunkingEnabled

public void setChunkingEnabled(boolean a_ChunkingEnabled)
Sets the value of the attribute: chunkingEnabled.

Supported API: false

Parameters:
a_ChunkingEnabled -

appendWhere

public void appendWhere(WhereExpression a_where,
                        LogicalOperator a_logicalOperator)
                 throws WTPropertyVetoException
Appends the WhereExpression to the WHERE clause.

Supported API: true

Parameters:
a_where - The WhereExpression to append.
a_logicalOperator - The logical operator to use when appending, if there is an existing Where expression.
Throws:
WTPropertyVetoException

appendWhere

public void appendWhere(WTCollection a_objects,
                        boolean a_checkUpdateCount,
                        LogicalOperator a_logicalOperator)
                 throws WTException,
                        WTPropertyVetoException
This method appends a WhereEpression to include the specified objects by object ID.

Supported API: true

Parameters:
a_objects - Objects to build expression for
a_checkUpdateCount - If true, then the update counts of the objects are included in the criteria.
a_logicalOperator - The logical operator to use when appending, if there is an existing Where expression.
Throws:
WTException
WTPropertyVetoException

buildIdUpdateCountSubSelectExpression

private static SubSelectExpression buildIdUpdateCountSubSelectExpression(WTCollection a_targetObjects,
                                                                         boolean a_useColumnList)
                                                                  throws WTException,
                                                                         WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

buildIdUpdateCountQuerySpec

private static QuerySpec buildIdUpdateCountQuerySpec(Class a_targetClass,
                                                     WTCollection a_targetObjects,
                                                     boolean a_useColumnList)
                                              throws WTException,
                                                     WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

buildIdUpdateCountTableExpression

private static ArrayTableExpression buildIdUpdateCountTableExpression(WTCollection a_targetObjects,
                                                                      long[] a_idValues)
                                                               throws WTException,
                                                                      WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

buildIdUpdateCountWhereExpression

private static WhereExpression buildIdUpdateCountWhereExpression(Class a_targetClass,
                                                                 Persistable a_targetObject)
                                                          throws WTException
Throws:
WTException

validate

private void validate(WhereExpression a_where)
               throws WTPropertyVetoException
Throws:
WTPropertyVetoException