|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.epm.util.PLSQLQuery
The PLSQLQuery is a server-side only class that describes a simple
SQL query that is executed using PL/SQL stored procedures.
Supported API: false
Extendable: false
Nested Class Summary | |
static class |
PLSQLQuery.Operator
|
protected static class |
PLSQLQuery.WhereExpression
|
Field Summary | |
private String[] |
aliases
|
private int |
conditionCount
|
static PLSQLQuery.Operator |
EQUAL
|
private StringBuffer |
extraConditions
|
private boolean |
includeDescendants
|
static PLSQLQuery.Operator |
IS_FALSE
|
static PLSQLQuery.Operator |
IS_TRUE
|
static PLSQLQuery.Operator |
LIKE
|
static PLSQLQuery.Operator |
NOT_EQUAL
|
private Class[] |
tableClasses
|
Constructor Summary | |
|
PLSQLQuery(Class tableClass)
Constructs a PLSQLQuery for the given object class. |
protected |
PLSQLQuery(Class[] tableClasses,
String[] aliases)
|
Method Summary | |
void |
appendAnd()
Appends an AND condition to the WHERE clause. |
void |
appendCloseParen()
Appends a closed parenthesis to the WHERE clause. |
void |
appendOpenParen()
Appends an open parenthesis to the WHERE clause. |
void |
appendOr()
Appends an OR condition to the WHERE clause. |
protected void |
appendWhere(PLSQLQuery.WhereExpression expression,
int fromIndex)
|
void |
appendWhere(String attribute,
PLSQLQuery.Operator op)
Appends a search condition for a boolean attribute to the WHERE clause. |
void |
appendWhere(String attribute,
PLSQLQuery.Operator op,
EnumeratedType value)
Appends a search condition for an enumerated type attribute to the WHERE clause. |
void |
appendWhere(String attribute,
PLSQLQuery.Operator op,
int value)
Appends a search condition for an integer attribute to the WHERE clause. |
void |
appendWhere(String attribute,
PLSQLQuery.Operator op,
long value)
Appends a search condition for a long attribute to the WHERE clause. |
void |
appendWhere(String attribute,
PLSQLQuery.Operator op,
String value)
Appends a search condition for a string attribute to the WHERE clause. |
protected abstract String |
buildFromClause()
Builds FROM clause. |
static ObjectIdentifier |
buildObjectId(Object className,
Object databaseId)
Builds an ObjectIdentifier from raw data returned from a stored procedure. |
protected abstract Object |
buildResult(Object[] rawData)
Builds a result using the raw data returned by the stored procedure. |
List |
buildResults(Object[] rawDataArray)
Builds the results using the raw data returned by the stored procedure. |
protected abstract String |
buildSelectStatement()
Builds SELECT statement. |
String |
buildSQLStatement()
Builds the SQL statement to send to the stored procedure. |
protected abstract String |
buildWhereClause()
Builds WHERE clause. |
String |
getAlias(int fromIndex)
|
protected static String |
getColumnName(Class linkClass,
LinkProxy.Role role)
Given a link class and a role, find the name of the database column for the role identifier. |
protected static String |
getColumnName(Class objectClass,
String attribute)
Given an object class and the name of an attribute on that class, find the name of the database column for that attribute. |
int |
getConditionCount()
|
protected abstract String |
getSQLFunctionName()
Returns the name of the stored procedure to call. |
protected abstract StatementParameter[] |
getSQLFunctionParameters()
Returns an array of parameters to pass to the stored procedure. |
protected abstract StatementParameter |
getSQLFunctionReturnType()
Returns the type of parameter the stored procedure is expected to return. |
Class |
getTableClass(int fromIndex)
|
static String[] |
getTableNames(Class objectClass)
Returns the names of the database tables for the given object class and its subclasses. |
protected String[] |
getTableNames(int fromIndex)
Returns the names of the database tables for the object class at given index in the FROM clause and its subclasses. |
void |
setIncludeDescendants(boolean includeDescendants)
Whether or not to query the database tables for all of the subclasses of the object class. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final PLSQLQuery.Operator EQUAL
public static final PLSQLQuery.Operator NOT_EQUAL
public static final PLSQLQuery.Operator IS_TRUE
public static final PLSQLQuery.Operator IS_FALSE
public static final PLSQLQuery.Operator LIKE
private Class[] tableClasses
private String[] aliases
private StringBuffer extraConditions
private int conditionCount
private boolean includeDescendants
Constructor Detail |
public PLSQLQuery(Class tableClass) throws WTException
protected PLSQLQuery(Class[] tableClasses, String[] aliases) throws WTException
Method Detail |
public Class getTableClass(int fromIndex)
public String getAlias(int fromIndex)
public int getConditionCount()
public void setIncludeDescendants(boolean includeDescendants)
public String buildSQLStatement() throws WTException
WTException
public List buildResults(Object[] rawDataArray) throws WTException
WTException
public String toString()
protected String[] getTableNames(int fromIndex) throws WTException
WTException
protected abstract String buildSelectStatement() throws WTException
WTException
protected abstract String buildFromClause() throws WTException
WTException
protected abstract String buildWhereClause() throws WTException
WTException
protected abstract Object buildResult(Object[] rawData) throws WTException
WTException
protected abstract String getSQLFunctionName()
protected abstract StatementParameter[] getSQLFunctionParameters() throws WTException
WTException
protected abstract StatementParameter getSQLFunctionReturnType() throws WTException
WTException
public void appendAnd()
public void appendOr()
public void appendOpenParen()
public void appendCloseParen()
public void appendWhere(String attribute, PLSQLQuery.Operator op) throws WTException
WTException
public void appendWhere(String attribute, PLSQLQuery.Operator op, int value) throws WTException
WTException
public void appendWhere(String attribute, PLSQLQuery.Operator op, long value) throws WTException
WTException
public void appendWhere(String attribute, PLSQLQuery.Operator op, String value) throws WTException
WTException
public void appendWhere(String attribute, PLSQLQuery.Operator op, EnumeratedType value) throws WTException
WTException
protected void appendWhere(PLSQLQuery.WhereExpression expression, int fromIndex) throws WTException
WTException
public static String[] getTableNames(Class objectClass) throws WTException
WTException
public static ObjectIdentifier buildObjectId(Object className, Object databaseId) throws WTException
WTException
protected static String getColumnName(Class objectClass, String attribute) throws WTException
WTException
protected static String getColumnName(Class linkClass, LinkProxy.Role role) throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |