|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.query.ClassAttribute
This class represents a class attribute which can be used in a SQL statement. Introspection information is used to determine the associated table and column.
When a query executes, a ClassAttribute used in the query internally
references a TableExpression from that query. A single instance of
ClassAttribute must only be associated to a single TableExpression.
If multiple classes are used in the query or a sub-select is used, then
a single instances of ClassAttribute should not be reused in different
query expressions. Instead, construct multiple instances, as needed.
Supported API: true
Extendable: false
Field Summary | |
private boolean |
advancedQueryEnabled
|
private String |
alias
|
private String |
attributeName
|
private static String |
CLASSNAME
|
private String |
columnAlias
|
private ColumnDescriptor |
columnDescriptor
|
private boolean |
correlated
|
private TableExpression |
correlatedTable
|
static long |
EXTERNALIZATION_VERSION_UID
|
private Class |
javaType
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
private Class |
targetClass
|
private boolean |
useExplicitAlias
|
private boolean |
useViewTableAlias
|
private String |
viewTableAlias
|
private Class |
viewTableClass
|
Fields inherited from interface wt.query.ColumnExpression |
ADVANCED_QUERY, ADVANCED_QUERY_ENABLED, COLUMN_ALIAS, JAVA_TYPE |
Fields inherited from interface wt.query.Expression |
FROM_COUNT |
Fields inherited from interface wt.query.RelationalExpression |
BIND_PARAMETER |
Constructor Summary | |
ClassAttribute()
Supported API: false |
|
ClassAttribute(Class a_targetClass,
String a_attributeName)
Supported API: true |
|
ClassAttribute(Class a_targetClass,
String a_attributeName,
String a_fromAlias)
Supported API: false |
Method Summary | |
String |
getActualTableAlias(Vector a_tableInfos,
Vector a_aliases)
|
Class |
getActualTargetClass(Vector a_tableInfos,
Vector a_aliases)
|
private AliasDescriptor |
getAliasDescriptor(Class a_class)
|
String |
getAttributeName()
Gets the value of the attribute: attributeName; The class's attribute. |
Object |
getBindParameter()
Gets the value of the attribute: bindParameter; Returns a bind parameter for this expression (if supported). |
List |
getClassAttributes()
Supported API: false |
String |
getColumnAlias()
Gets the value of the attribute: columnAlias; Alias for the column expression. |
ColumnDescriptor |
getColumnDescriptor()
Gets the value of the attribute: columnDescriptor; The associated introspection ColumnDescriptor. |
TableExpression |
getCorrelatedTable()
Gets the value of the attribute: correlatedTable. |
String |
getExpression(boolean a_useBind,
Vector a_tableInfos,
Vector a_aliases,
boolean a_outerJoin)
Return string representation of this expression. |
String |
getFromAlias()
Supported API: false |
int |
getFromCount()
Gets the value of the attribute: fromCount; Number of from index values that this expression requires Supported API: false |
Class |
getJavaType()
Gets the value of the attribute: javaType; The java type of this expression. |
String |
getTableAliasInView(Vector a_tableInfos,
Vector a_aliases)
|
Class |
getTargetClass()
Gets the object for the association that plays role: targetClass. |
String |
getViewTableAlias()
Gets the value of the attribute: viewTableAlias. |
Class |
getViewTableClass()
Gets the value of the attribute: viewTableClass. |
boolean |
isAdvancedQuery()
Gets the value of the attribute: advancedQuery; Indicates if the expression uses advanced query capabilities. |
boolean |
isAdvancedQueryEnabled()
Gets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled. |
boolean |
isCorrelated()
Gets the value of the attribute: correlated. |
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(ClassAttribute thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
void |
setAdvancedQueryEnabled(boolean a_AdvancedQueryEnabled)
Sets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled. |
void |
setAttributeName(String a_AttributeName)
Sets the value of the attribute: attributeName; The class's attribute. |
void |
setColumnAlias(String a_ColumnAlias)
Sets the value of the attribute: columnAlias; Alias for the column expression. |
void |
setCorrelated(boolean a_Correlated)
Sets the value of the attribute: correlated. |
void |
setCorrelatedTable(TableExpression a_CorrelatedTable)
Sets the value of the attribute: correlatedTable. |
int |
setFromAlias(String[] a_aliases,
int a_offset)
This method sets the FROM clause alias for this expression. |
void |
setTargetClass(Class a_TargetClass)
Sets the object for the association that plays role: targetClass. |
void |
setUseViewTableAlias(boolean a_UseViewTableAlias)
Sets the value of the attribute: useViewTableAlias. |
void |
setViewTableAlias(String a_ViewTableAlias)
Sets the value of the attribute: viewTableAlias. |
void |
setViewTableClass(Class a_ViewTableClass)
Sets the value of the attribute: viewTableClass. |
private void |
targetClassValidate(Class a_TargetClass)
|
String |
toString()
|
private boolean |
validate(Class a_class,
String a_attribute)
|
int |
validate(TableExpression[] a_tableExpressions,
int a_offset)
This method validates this expression against the specified table expression. |
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, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private String attributeName
private String alias
private boolean useExplicitAlias
private String viewTableAlias
private Class viewTableClass
private boolean useViewTableAlias
private boolean correlated
private TableExpression correlatedTable
private Class targetClass
private String columnAlias
private transient boolean advancedQueryEnabled
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private transient ColumnDescriptor columnDescriptor
private transient Class javaType
Constructor Detail |
public ClassAttribute(Class a_targetClass, String a_attributeName) throws QueryException
a_targetClass
- Specifies the class.a_attributeName
- Specifies the class's attribute.
QueryException
public ClassAttribute(Class a_targetClass, String a_attributeName, String a_fromAlias) throws QueryException
a_targetClass
- Specifies the class.a_attributeName
- Specifies the class attribute.a_fromAlias
- Specifies a FROM clause table alias that will be used when constructing the expression.
QueryException
public ClassAttribute()
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(ClassAttribute 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 String getAttributeName()
public void setAttributeName(String a_AttributeName) throws WTPropertyVetoException
a_AttributeName
-
WTPropertyVetoException
public ColumnDescriptor getColumnDescriptor() throws PersistenceException
PersistenceException
public String getViewTableAlias()
public void setViewTableAlias(String a_ViewTableAlias)
a_ViewTableAlias
- public Class getViewTableClass()
public void setViewTableClass(Class a_ViewTableClass)
a_ViewTableClass
- public boolean isUseViewTableAlias()
public void setUseViewTableAlias(boolean a_UseViewTableAlias)
a_UseViewTableAlias
- public boolean isCorrelated()
public void setCorrelated(boolean a_Correlated)
a_Correlated
- public TableExpression getCorrelatedTable()
public void setCorrelatedTable(TableExpression a_CorrelatedTable)
a_CorrelatedTable
- public Class getTargetClass()
public void setTargetClass(Class a_TargetClass) throws WTPropertyVetoException
a_TargetClass
-
WTPropertyVetoException
private void targetClassValidate(Class a_TargetClass) throws WTPropertyVetoException
a_TargetClass
-
WTPropertyVetoException
public String getFromAlias()
public String getColumnAlias()
getColumnAlias
in interface ColumnExpression
public void setColumnAlias(String a_ColumnAlias) throws WTPropertyVetoException
setColumnAlias
in interface ColumnExpression
a_ColumnAlias
-
WTPropertyVetoException
public Class getJavaType() throws WTException
getJavaType
in interface ColumnExpression
WTException
public boolean isAdvancedQuery() throws WTException
isAdvancedQuery
in interface ColumnExpression
WTException
public boolean isAdvancedQueryEnabled()
isAdvancedQueryEnabled
in interface ColumnExpression
public void setAdvancedQueryEnabled(boolean a_AdvancedQueryEnabled)
setAdvancedQueryEnabled
in interface ColumnExpression
a_AdvancedQueryEnabled
- public int getFromCount()
getFromCount
in interface Expression
public int validate(TableExpression[] a_tableExpressions, int a_offset) throws QueryException
validate
in interface Expression
a_tableExpressions
- Table expression to validate against.a_offset
- Offset index into the TableExpression array for the next valid TableExpression
QueryException
public int setFromAlias(String[] a_aliases, int a_offset)
setFromAlias
in interface Expression
a_aliases
- Array of aliases for expressionsa_offset
- Offset index into the alias array for the next valid alias
public Object getBindParameter() throws WTException
getBindParameter
in interface RelationalExpression
WTException
public String getExpression(boolean a_useBind, Vector a_tableInfos, Vector a_aliases, boolean a_outerJoin) throws QueryException
getExpression
in interface RelationalExpression
a_useBind
- Indicates that bind variables should be used for this expression.a_tableInfos
- a_aliases
- a_outerJoin
- Indicates that outer join syntax should be used for this expression.
QueryException
public List getClassAttributes()
getClassAttributes
in interface RelationalExpression
public Class getActualTargetClass(Vector a_tableInfos, Vector a_aliases) throws WTException
WTException
public String getTableAliasInView(Vector a_tableInfos, Vector a_aliases) throws WTException
WTException
public String getActualTableAlias(Vector a_tableInfos, Vector a_aliases) throws WTException
WTException
public String toString()
private AliasDescriptor getAliasDescriptor(Class a_class) throws WTException
WTException
private boolean validate(Class a_class, String a_attribute) throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |