wt.pds
Class SequentialResultBuilder

java.lang.Object
  extended bywt.pds.SequentialResultBuilder
All Implemented Interfaces:
Cloneable, Externalizable, ResultBuilder, Serializable
Direct Known Subclasses:
ClassViewSequentialResultBuilder

public class SequentialResultBuilder
extends Object
implements ResultBuilder, Externalizable

This class is a basic implementation that defers processing to the ItemBuilders it contains. The SELECT columns of each Item Builder are appended squentially. A single ObjectTable is used for all Item Builders to optimize object building.

This class performs access checking as each object is built. If any object does not pass access control, then the entire no results are returned for the entire row.

Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private)  class SequentialResultBuilder.AllItemBuilders
           
 
Field Summary
private  Vector accessControlItemBuilders
           
private  AccessControllerProcessor accessControllerProcessor
           
private  AttributeMapInfo attributeMapInfo
           
private static String CLASSNAME
           
static boolean DEBUG
           
static long EXTERNALIZATION_VERSION_UID
           
private  boolean isAllPersistable
           
private  Vector itemBuilders
           
private  int itemCount
           
private  int itemStartOffset
           
private static DebugWriter LOG
           
private  ObjectTable objectTable
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
private  ResultSet resultSet
           
(package private) static long serialVersionUID
           
 
Fields inherited from interface wt.pds.ResultBuilder
ACCESS_CONTROLLER_PROCESSOR, ATTRIBUTE_MAP_INFO, DESCENDANT_QUERY_TYPE_COMPATIBLE, ITEM_BUILDERS, OBJECT_TABLE
 
Constructor Summary
SequentialResultBuilder()
           
 
Method Summary
 void addItemBuilder(ItemBuilder a_itemBuilder)
          Add an ItemBuilder that will be used to build results.
 Object[] build(ResultSet a_resultSet, StatementBuilder a_statementBuilder)
          Builds object from the result set.
 String buildEmptyAggregateSelect()
          

Supported API: false
 String buildSelect(Vector a_tableInfos, Vector a_aliases)
          Builds the select columns for the results.
 Object clone()
          Create a deep-copy of this object.
private  void createItemResultSets(ResultSet a_resultSet)
          This method is used to create new result sets for each ItemBuilder.
 AccessControllerProcessor getAccessControllerProcessor()
          Gets the object for the association that plays role: accessControllerProcessor.
private  Enumeration getAllItemBuilders()
           
 AttributeMapInfo getAttributeMapInfo()
          Gets the object for the association that plays role: attributeMapInfo.
 Vector getItemBuilders()
          Gets the object for the association that plays role: itemBuilders.
 Class getItemPrimaryClass(Vector a_classInfos, int a_itemBuilderIndex)
          Returns the primary class for the specified ItemBuilder.
 ObjectTable getObjectTable()
          Gets the value of the attribute: objectTable; Cache of objects valid for the lifetime of a retrieve.
 boolean isDescendantQueryTypeCompatible()
          Gets the value of the attribute: descendantQueryTypeCompatible; Indicates whether descendant query results will be guranteed to be type compatible (i.e.
 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(SequentialResultBuilder thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void reset()
          Resets the instance so that it can be re-used to process a new result.
 void setAccessControllerProcessor(AccessControllerProcessor a_AccessControllerProcessor)
          Sets the object for the association that plays role: accessControllerProcessor.
 void setAttributeMapInfo(AttributeMapInfo a_AttributeMapInfo)
          Sets the object for the association that plays role: attributeMapInfo.
 boolean setCurrentResultBuilder(ResultBuilder a_resultBuilder, int a_currentIndex)
          

Supported API: false
 void setItemStartOffset(int a_itemStartOffset)
          

Supported API: false
 void setNonEmptyComponentIndex(int a_nonEmptyComponentIndex)
          

Supported API: false
 void setObjectTable(ObjectTable a_ObjectTable)
          Sets the value of the attribute: objectTable; Cache of objects valid for the lifetime of a retrieve.
 String toString()
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

objectTable

private transient ObjectTable objectTable

itemStartOffset

private transient int itemStartOffset

attributeMapInfo

private transient AttributeMapInfo attributeMapInfo

itemBuilders

private Vector itemBuilders

accessControllerProcessor

private transient AccessControllerProcessor accessControllerProcessor

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

resultSet

private transient ResultSet resultSet

itemCount

private transient int itemCount

isAllPersistable

private transient boolean isAllPersistable

accessControlItemBuilders

private transient Vector accessControlItemBuilders
Constructor Detail

SequentialResultBuilder

public SequentialResultBuilder()
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(SequentialResultBuilder 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

getObjectTable

public ObjectTable getObjectTable()
Gets the value of the attribute: objectTable; Cache of objects valid for the lifetime of a retrieve.

Supported API: false

Specified by:
getObjectTable in interface ResultBuilder
Returns:
ObjectTable

setObjectTable

public void setObjectTable(ObjectTable a_ObjectTable)
                    throws WTPropertyVetoException
Sets the value of the attribute: objectTable; Cache of objects valid for the lifetime of a retrieve.

Supported API: false

Specified by:
setObjectTable in interface ResultBuilder
Parameters:
a_ObjectTable -
Throws:
WTPropertyVetoException

getAttributeMapInfo

public AttributeMapInfo getAttributeMapInfo()
Gets the object for the association that plays role: attributeMapInfo.

Supported API: false

Specified by:
getAttributeMapInfo in interface ResultBuilder
Returns:
AttributeMapInfo

setAttributeMapInfo

public void setAttributeMapInfo(AttributeMapInfo a_AttributeMapInfo)
                         throws WTPropertyVetoException
Sets the object for the association that plays role: attributeMapInfo.

Supported API: false

Specified by:
setAttributeMapInfo in interface ResultBuilder
Parameters:
a_AttributeMapInfo -
Throws:
WTPropertyVetoException

getItemBuilders

public Vector getItemBuilders()
Gets the object for the association that plays role: itemBuilders.

Supported API: false

Specified by:
getItemBuilders in interface ResultBuilder
Returns:
Vector

getAccessControllerProcessor

public AccessControllerProcessor getAccessControllerProcessor()
Gets the object for the association that plays role: accessControllerProcessor.

Supported API: false

Specified by:
getAccessControllerProcessor in interface ResultBuilder
Returns:
AccessControllerProcessor

setAccessControllerProcessor

public void setAccessControllerProcessor(AccessControllerProcessor a_AccessControllerProcessor)
                                  throws WTPropertyVetoException
Sets the object for the association that plays role: accessControllerProcessor.

Supported API: false

Specified by:
setAccessControllerProcessor in interface ResultBuilder
Parameters:
a_AccessControllerProcessor -
Throws:
WTPropertyVetoException

buildEmptyAggregateSelect

public String buildEmptyAggregateSelect()
                                 throws PersistenceException


Supported API: false

Returns:
String
Throws:
PersistenceException

isDescendantQueryTypeCompatible

public boolean isDescendantQueryTypeCompatible()
Gets the value of the attribute: descendantQueryTypeCompatible; Indicates whether descendant query results will be guranteed to be type compatible (i.e. all corressponding columns have the same type.

Supported API: false

Specified by:
isDescendantQueryTypeCompatible in interface ResultBuilder
Returns:
boolean

buildSelect

public String buildSelect(Vector a_tableInfos,
                          Vector a_aliases)
                   throws PersistenceException
Builds the select columns for the results.

Supported API: false

Specified by:
buildSelect in interface ResultBuilder
Parameters:
a_tableInfos - Vector of TableExpression instances to use for building the Select statement
a_aliases - Vector of String aliases to use for building the Select statement
Returns:
String
Throws:
PersistenceException

build

public Object[] build(ResultSet a_resultSet,
                      StatementBuilder a_statementBuilder)
               throws PersistenceException
Builds object from the result set.

Supported API: false

Specified by:
build in interface ResultBuilder
Parameters:
a_resultSet -
a_statementBuilder -
Returns:
Object[]
Throws:
PersistenceException

addItemBuilder

public void addItemBuilder(ItemBuilder a_itemBuilder)
Add an ItemBuilder that will be used to build results.

Supported API: false

Specified by:
addItemBuilder in interface ResultBuilder
Parameters:
a_itemBuilder -

getItemPrimaryClass

public Class getItemPrimaryClass(Vector a_classInfos,
                                 int a_itemBuilderIndex)
Returns the primary class for the specified ItemBuilder.

Supported API: false

Specified by:
getItemPrimaryClass in interface ResultBuilder
Parameters:
a_classInfos -
a_itemBuilderIndex -
Returns:
Class

reset

public void reset()
Resets the instance so that it can be re-used to process a new result.

Supported API: false

Specified by:
reset in interface ResultBuilder

setItemStartOffset

public void setItemStartOffset(int a_itemStartOffset)


Supported API: false

Specified by:
setItemStartOffset in interface ResultBuilder
Parameters:
a_itemStartOffset -

setCurrentResultBuilder

public boolean setCurrentResultBuilder(ResultBuilder a_resultBuilder,
                                       int a_currentIndex)


Supported API: false

Specified by:
setCurrentResultBuilder in interface ResultBuilder
Parameters:
a_resultBuilder -
a_currentIndex -
Returns:
boolean

setNonEmptyComponentIndex

public void setNonEmptyComponentIndex(int a_nonEmptyComponentIndex)


Supported API: false

Specified by:
setNonEmptyComponentIndex in interface ResultBuilder
Parameters:
a_nonEmptyComponentIndex -

createItemResultSets

private void createItemResultSets(ResultSet a_resultSet)
                           throws PersistenceException
This method is used to create new result sets for each ItemBuilder.

Parameters:
a_resultSet -
Throws:
PersistenceException

getAllItemBuilders

private Enumeration getAllItemBuilders()

clone

public Object clone()
Create a deep-copy of this object.

Specified by:
clone in interface ResultBuilder

toString

public String toString()