|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.pds.BasicStatementBuilder
wt.pds.ObjectReferenceStatementBuilder
This class builds select statements for Object References of a given
class. The ObjectReferences are set via an attribute OidArray. To build
the SQL statements, the array is processed to determine the concrete
tables that need to be queried. The ObjectReferences can reference the
targetClass or any of its descendant classes. For each concrete table,
a SQL statement is built returning all of the attributes necessary to
build a full object. The SQL statements will use the associated whereClause
and table expressions for the appropriate object IDs. Table expressions
are used so that associated object IDs and duplicate object IDs from
the OidArray are returned correctly.
Supported API: false
Extendable: false
Nested Class Summary | |
(package private) static class |
ObjectReferenceStatementBuilder.IdList
|
(package private) static class |
ObjectReferenceStatementBuilder.SingleColumnUniqueIdList
|
Field Summary | |
private Object[] |
bindParameters
|
private static String |
CLASSNAME
|
private static String |
DELIMITER
|
static long |
EXTERNALIZATION_VERSION_UID
|
private FromClause |
fromClause
|
private static Vector |
HINTS
|
private static Class[] |
ID_LIST_TYPE
|
private static String |
OID_ALIAS
|
private OidArray |
oidArray
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
private boolean |
singleTableMode
|
private static boolean |
TYPE_USAGE_ENABLED
|
private WhereClause |
whereClause
|
Fields inherited from class wt.pds.BasicStatementBuilder |
DMLGENERATOR |
Fields inherited from interface wt.pds.StatementBuilder |
CHUNKING_ENABLED, FETCH_SIZE, SQL_STATEMENTS, STATEMENT_COUNT |
Constructor Summary | |
ObjectReferenceStatementBuilder()
Supported API: false |
Method Summary | |
private static TableExpression |
buildConstantTableExpression(ObjectReferenceStatementBuilder.IdList a_idList,
int a_columnCount,
int a_beginIndex,
int a_endIndex)
|
private Vector |
buildOidTableExpressions(ObjectReferenceStatementBuilder.IdList a_idList)
|
String[] |
buildSQL(ResultBuilder a_resultBuilder,
WTConnection a_connection,
boolean a_isComponent,
boolean a_isComponentChunkSupported)
Returns an array of JDBC statements to execute. |
private String |
getClassNameKey(int a_rowIndex)
|
FromClause |
getFromClause()
Gets the object for the association that plays role: fromClause. |
OidArray |
getOidArray()
Gets the object for the association that plays role: oidArray. |
boolean |
getSingleTableMode()
|
Vector |
getStatementBindParameters(int a_sqlIndex)
Returns a Vector of bind parameters for the specified statement. |
private ClassTableExpression |
getTableExpression(String a_className,
int a_fromIndex)
|
private void |
getTables(String a_classNames,
Vector a_tables)
|
WhereClause |
getWhereClause()
Gets the object for the association that plays role: whereClause. |
private boolean |
isAllUniqueIds(HashMap a_classIds)
|
private void |
oidArrayValidate(OidArray a_OidArray)
|
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(ObjectReferenceStatementBuilder thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
void |
setOidArray(OidArray a_OidArray)
Sets the object for the association that plays role: oidArray. |
void |
setSingleTableMode(boolean a_singleTableMode)
|
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class wt.pds.BasicStatementBuilder |
appendBindParameter, buildSQL, clone, getFetchSize, getSqlStatements, getStatement, getStatementCount, insertBindParameterAt, isChunkingEnabled, readVersion, setChunkingEnabled, setFetchSize, setSqlStatements |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private WhereClause whereClause
private FromClause fromClause
private OidArray oidArray
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private transient Object[] bindParameters
private transient boolean singleTableMode
private static final String DELIMITER
private static final Class[] ID_LIST_TYPE
private static final String OID_ALIAS
private static final boolean TYPE_USAGE_ENABLED
private static final Vector HINTS
Constructor Detail |
public ObjectReferenceStatementBuilder()
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class BasicStatementBuilder
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class BasicStatementBuilder
input
-
IOException
ClassNotFoundException
protected boolean readVersion(ObjectReferenceStatementBuilder thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public WhereClause getWhereClause()
public FromClause getFromClause()
public OidArray getOidArray()
public void setOidArray(OidArray a_OidArray) throws WTPropertyVetoException
a_OidArray
-
WTPropertyVetoException
private void oidArrayValidate(OidArray a_OidArray) throws WTPropertyVetoException
a_OidArray
-
WTPropertyVetoException
public String[] buildSQL(ResultBuilder a_resultBuilder, WTConnection a_connection, boolean a_isComponent, boolean a_isComponentChunkSupported) throws PersistenceException
buildSQL
in interface StatementBuilder
a_resultBuilder
- a_connection
- a_isComponent
- Indicates that these SQL statements will be used as nested components of another SQL statement.a_isComponentChunkSupported
- Indicates that these SQL statements will support chunk or not, and the value will be false when a_isComponent is false, and can be true or false when a_isComponents is true.
PersistenceException
public Vector getStatementBindParameters(int a_sqlIndex) throws PersistenceException
getStatementBindParameters
in interface StatementBuilder
getStatementBindParameters
in class BasicStatementBuilder
a_sqlIndex
-
PersistenceException
public boolean getSingleTableMode()
public void setSingleTableMode(boolean a_singleTableMode)
private boolean isAllUniqueIds(HashMap a_classIds)
private String getClassNameKey(int a_rowIndex)
private void getTables(String a_classNames, Vector a_tables) throws WTException, ClassNotFoundException
WTException
ClassNotFoundException
private ClassTableExpression getTableExpression(String a_className, int a_fromIndex) throws WTException, ClassNotFoundException
WTException
ClassNotFoundException
private Vector buildOidTableExpressions(ObjectReferenceStatementBuilder.IdList a_idList) throws WTException
WTException
private static TableExpression buildConstantTableExpression(ObjectReferenceStatementBuilder.IdList a_idList, int a_columnCount, int a_beginIndex, int a_endIndex)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |