wt.pds
Class PersistableItemBuilder

java.lang.Object
  extended bywt.pds.PersistableItemBuilder
All Implemented Interfaces:
Externalizable, ItemBuilder, Serializable
Direct Known Subclasses:
PersistableViewItemBuilder

public class PersistableItemBuilder
extends Object
implements ItemBuilder, Externalizable

This class provides the functionality for building a "full" object from a result set. All of the attributes in the object are included in the result set.

The internal implementation relies on the WTResultSet class to perform the relational to object mapping.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private  int classIndex
           
private static String CLASSNAME
           
protected static DMLGenerator DMLGENERATOR
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private  PersistentRetrieveIfc persistentRetrieve
           
private  Persistable refreshObject
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static HashMap SQL_MAP
           
private  Class targetClass
           
private static ConstantExpression TIMESTAMP_FORMAT_EXPRESSION
           
private  boolean useViewTableAlias
           
 
Fields inherited from interface wt.pds.ItemBuilder
ACCESS_CONTROLLED_FROM_INDICIES, COLUMNS, DESCENDANT_QUERY_TYPE_COMPATIBLE, FROM_INDICIES, ITEM_COUNT
 
Constructor Summary
PersistableItemBuilder()
          

Supported API: false
PersistableItemBuilder(int a_classIndex)
          

Supported API: false
 
Method Summary
 Object build()
          Builds an object from the current row in the result set.
protected  void buildClassnameSelect(String a_alias, String a_columnName, ClassInfo a_classInfo, StringBuffer a_select)
          Builds a select Classname column for the object.
protected  void buildColumnSelect(String a_alias, AliasDescriptor a_columnName, StringBuffer a_select)
          Builds a select column for the object.
protected  void buildColumnSelect(String a_alias, String a_columnName, StringBuffer a_select)
          Builds a select column for the object.
 int buildEmptyAggregateColumn(AttributeMapInfo a_attributeMapInfo, StringBuffer a_select)
          Builds the select columns for building an object.
 int buildSelect(Vector a_tableInfos, Vector a_aliases, AttributeMapInfo a_attributeMapInfo, StringBuffer a_select)
          Builds the select columns for building an object.
protected  void buildSQLSelect(ColumnDescriptor[] columns, ClassInfo a_classInfo, String a_alias, StringBuffer a_select)
           
protected  void buildTimestampSelect(String a_alias, AliasDescriptor a_columnName, StringBuffer a_select)
          Builds a select Timestamp column for the object.
protected  void buildTimestampSelect(String a_alias, String a_columnName, StringBuffer a_select)
          Builds a select Timestamp column for the object.
 int createPersistentRetrieve(ResultSet a_resultSet, ObjectTable a_objectTable, int a_resultOffset, AttributeMapInfo a_attributeMapInfo)
          Creates the persistent retrieve object for this item.
 int[] getAccessControlledFromIndicies()
          Gets the value of the attribute: accessControlledFromIndicies; Array of index values for items in the FromClause.
protected  String getAlias(Vector a_aliases)
           
 int getClassIndex()
          Gets the value of the attribute: classIndex; Index of the class in the classInfos Vector.
protected  ClassInfo getClassInfo(Vector a_classInfos)
          

Supported API: false
 ColumnExpression[] getColumns()
          Gets the value of the attribute: columns; Returns ColumnExpressions for this item.
 int[] getFromIndicies()
          Gets the value of the attribute: fromIndicies; Array of index values for items in the FromClause.
 int getItemCount()
          Gets the value of the attribute: itemCount; Number of items that are built.
 Class getPrimaryClass(Vector a_classInfos)
          Returns the primary class for this Item.
 Persistable getRefreshObject()
          Gets the object for the association that plays role: refreshObject.
protected  Map getSQLMap()
           
 boolean isDescendantQueryTypeCompatible()
          Gets the value of the attribute: descendantQueryTypeCompatible; Indicates whether descendant query results will be guranteed to be type compatible (i.e.
 boolean isUseViewTableAlias()
          Gets the value of the attribute: useViewTableAlias.
 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(PersistableItemBuilder 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 setClassIndex(int a_ClassIndex)
          Sets the value of the attribute: classIndex; Index of the class in the classInfos Vector.
 void setRefreshObject(Persistable a_RefreshObject)
          Sets the object for the association that plays role: refreshObject.
 void setTimeStampAttributeTimestampDisabled()
          Set the DateExpression in the ItemBuilder to the TimstampEnabled to false

Supported API: false
 void setUseViewTableAlias(boolean a_UseViewTableAlias)
          Sets the value of the attribute: useViewTableAlias.
 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

classIndex

private int classIndex

persistentRetrieve

private transient PersistentRetrieveIfc persistentRetrieve

useViewTableAlias

private boolean useViewTableAlias

refreshObject

private Persistable refreshObject

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

targetClass

private transient Class targetClass

TIMESTAMP_FORMAT_EXPRESSION

private static final ConstantExpression TIMESTAMP_FORMAT_EXPRESSION

SQL_MAP

private static final HashMap SQL_MAP

DMLGENERATOR

protected static final DMLGenerator DMLGENERATOR
Constructor Detail

PersistableItemBuilder

public PersistableItemBuilder(int a_classIndex)
                       throws WTPropertyVetoException


Supported API: false

Parameters:
a_classIndex -
Throws:
WTPropertyVetoException

PersistableItemBuilder

public PersistableItemBuilder()


Supported API: false

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(PersistableItemBuilder 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

getClassIndex

public int getClassIndex()
Gets the value of the attribute: classIndex; Index of the class in the classInfos Vector.

Supported API: false

Returns:
int

setClassIndex

public void setClassIndex(int a_ClassIndex)
                   throws WTPropertyVetoException
Sets the value of the attribute: classIndex; Index of the class in the classInfos Vector.

Supported API: false

Parameters:
a_ClassIndex -
Throws:
WTPropertyVetoException

isUseViewTableAlias

public boolean isUseViewTableAlias()
Gets the value of the attribute: useViewTableAlias.

Supported API: false

Returns:
boolean

setUseViewTableAlias

public void setUseViewTableAlias(boolean a_UseViewTableAlias)
                          throws WTPropertyVetoException
Sets the value of the attribute: useViewTableAlias.

Supported API: false

Parameters:
a_UseViewTableAlias -
Throws:
WTPropertyVetoException

getRefreshObject

public Persistable getRefreshObject()
Gets the object for the association that plays role: refreshObject.

Supported API: false

Returns:
Persistable

setRefreshObject

public void setRefreshObject(Persistable a_RefreshObject)
                      throws WTPropertyVetoException
Sets the object for the association that plays role: refreshObject.

Supported API: false

Parameters:
a_RefreshObject -
Throws:
WTPropertyVetoException

getClassInfo

protected ClassInfo getClassInfo(Vector a_classInfos)
                          throws WTException


Supported API: false

Parameters:
a_classInfos -
Throws:
WTException

buildColumnSelect

protected void buildColumnSelect(String a_alias,
                                 String a_columnName,
                                 StringBuffer a_select)
                          throws PersistenceException
Builds a select column for the object.

Supported API: false

Parameters:
a_alias -
a_columnName -
a_select -
Throws:
PersistenceException

buildTimestampSelect

protected void buildTimestampSelect(String a_alias,
                                    String a_columnName,
                                    StringBuffer a_select)
                             throws PersistenceException
Builds a select Timestamp column for the object.

Supported API: false

Parameters:
a_alias -
a_columnName -
a_select -
Throws:
PersistenceException

buildClassnameSelect

protected void buildClassnameSelect(String a_alias,
                                    String a_columnName,
                                    ClassInfo a_classInfo,
                                    StringBuffer a_select)
                             throws PersistenceException
Builds a select Classname column for the object.

Supported API: false

Parameters:
a_alias -
a_columnName -
a_classInfo -
a_select -
Throws:
PersistenceException

buildColumnSelect

protected void buildColumnSelect(String a_alias,
                                 AliasDescriptor a_columnName,
                                 StringBuffer a_select)
                          throws PersistenceException
Builds a select column for the object.

Supported API: false

Parameters:
a_alias -
a_columnName -
a_select -
Throws:
PersistenceException

buildTimestampSelect

protected void buildTimestampSelect(String a_alias,
                                    AliasDescriptor a_columnName,
                                    StringBuffer a_select)
                             throws PersistenceException
Builds a select Timestamp column for the object.

Supported API: false

Parameters:
a_alias -
a_columnName -
a_select -
Throws:
PersistenceException

getItemCount

public int getItemCount()
Gets the value of the attribute: itemCount; Number of items that are built.

Supported API: false

Specified by:
getItemCount in interface ItemBuilder
Returns:
int

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 ItemBuilder
Returns:
boolean

getAccessControlledFromIndicies

public int[] getAccessControlledFromIndicies()
Gets the value of the attribute: accessControlledFromIndicies; Array of index values for items in the FromClause. This ItemBuilder provides Access Control for these FromExpressions.

Supported API: false

Specified by:
getAccessControlledFromIndicies in interface ItemBuilder
Returns:
int[]

getFromIndicies

public int[] getFromIndicies()
Gets the value of the attribute: fromIndicies; Array of index values for items in the FromClause. This ItemBuilder accesses these FromExpressions to build the item.

Supported API: false

Specified by:
getFromIndicies in interface ItemBuilder
Returns:
int[]

getColumns

public ColumnExpression[] getColumns()
                              throws WTException
Gets the value of the attribute: columns; Returns ColumnExpressions for this item. If null is returned, then this item cannot be resolved to a list of ColumnExpressions.

Supported API: false

Specified by:
getColumns in interface ItemBuilder
Returns:
ColumnExpression[]
Throws:
WTException

buildSelect

public int buildSelect(Vector a_tableInfos,
                       Vector a_aliases,
                       AttributeMapInfo a_attributeMapInfo,
                       StringBuffer a_select)
                throws PersistenceException
Builds the select columns for building an object.

Supported API: false

Specified by:
buildSelect in interface ItemBuilder
Parameters:
a_tableInfos -
a_aliases -
a_attributeMapInfo -
a_select -
Throws:
PersistenceException

build

public Object build()
             throws PersistenceException
Builds an object from the current row in the result set.

Supported API: false

Specified by:
build in interface ItemBuilder
Returns:
Object
Throws:
PersistenceException

createPersistentRetrieve

public int createPersistentRetrieve(ResultSet a_resultSet,
                                    ObjectTable a_objectTable,
                                    int a_resultOffset,
                                    AttributeMapInfo a_attributeMapInfo)
                             throws PersistenceException
Creates the persistent retrieve object for this item.

Supported API: false

Specified by:
createPersistentRetrieve in interface ItemBuilder
Parameters:
a_resultSet -
a_objectTable -
a_resultOffset -
a_attributeMapInfo -
Returns:
int
Throws:
PersistenceException

getPrimaryClass

public Class getPrimaryClass(Vector a_classInfos)
Returns the primary class for this Item.

Supported API: false

Specified by:
getPrimaryClass in interface ItemBuilder
Parameters:
a_classInfos -
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 ItemBuilder

buildEmptyAggregateColumn

public int buildEmptyAggregateColumn(AttributeMapInfo a_attributeMapInfo,
                                     StringBuffer a_select)
                              throws PersistenceException
Builds the select columns for building an object.

Supported API: false

Specified by:
buildEmptyAggregateColumn in interface ItemBuilder
Parameters:
a_attributeMapInfo -
a_select -
Throws:
PersistenceException

setTimeStampAttributeTimestampDisabled

public void setTimeStampAttributeTimestampDisabled()
                                            throws WTException
Set the DateExpression in the ItemBuilder to the TimstampEnabled to false

Supported API: false

Specified by:
setTimeStampAttributeTimestampDisabled in interface ItemBuilder
Throws:
WTException

getSQLMap

protected Map getSQLMap()

buildSQLSelect

protected void buildSQLSelect(ColumnDescriptor[] columns,
                              ClassInfo a_classInfo,
                              String a_alias,
                              StringBuffer a_select)
                       throws PersistenceException
Throws:
PersistenceException

getAlias

protected String getAlias(Vector a_aliases)