|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.expressions.Expression org.eclipse.persistence.internal.expressions.BaseExpression org.eclipse.persistence.internal.expressions.DataExpression org.eclipse.persistence.internal.expressions.ObjectExpression org.eclipse.persistence.expressions.ExpressionBuilder
public class ExpressionBuilder
Purpose: Allow for instances of expression to be created. Expressions are Java object-level representations of SQL "where" clauses. The expressions attempt to mirror Java code as closely as possible.
Example:
ExpressionBuilder employee = new ExpressionBuilder(); employee.get("firstName").equal("Bob").and(employee.get("lastName").equal("Smith")) >> equivalent Java code: (employee.getFirstName().equals("Bob")) && (employee.getLastName().equals("Smith")) >> equivalent SQL: (F_NAME = 'Bob') AND (L_NAME = 'Smith')
Expression
,
Serialized FormField Summary | |
---|---|
protected org.eclipse.persistence.internal.helper.DatabaseTable |
aliasedViewTable
|
protected java.lang.Class |
queryClass
|
protected org.eclipse.persistence.internal.sessions.AbstractSession |
session
|
protected org.eclipse.persistence.internal.expressions.SQLSelectStatement |
statement
|
protected org.eclipse.persistence.internal.helper.DatabaseTable |
viewTable
|
protected boolean |
wasAdditionJoinCriteriaUsed
|
protected boolean |
wasQueryClassSetInternally
|
Fields inherited from class org.eclipse.persistence.internal.expressions.ObjectExpression |
---|
derivedExpressions, descriptor, shouldUseOuterJoin, shouldUseOuterJoinForMultitableInheritance |
Fields inherited from class org.eclipse.persistence.internal.expressions.DataExpression |
---|
asOfClause, derivedFields, derivedTables, hasBeenNormalized, tableAliases |
Fields inherited from class org.eclipse.persistence.internal.expressions.BaseExpression |
---|
baseExpression, builder |
Fields inherited from class org.eclipse.persistence.expressions.Expression |
---|
currentAlias, hashCode, lastTable, selectIfOrderedBy |
Constructor Summary | |
---|---|
ExpressionBuilder()
PUBLIC: Create a new ExpressionBuilder. |
|
ExpressionBuilder(java.lang.Class queryClass)
ADVANCED: Create a new ExpressionBuilder representing instances of the argument class. |
Method Summary | |
---|---|
org.eclipse.persistence.internal.helper.DatabaseTable |
aliasForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: Find the alias for a given table. |
int |
assignTableAliasesStartingAt(int initialValue)
INTERNAL: Assign aliases to any tables which I own. |
java.lang.String |
descriptionOfNodeType()
INTERNAL: Used for debug printing. |
boolean |
doesNotRepresentAnObjectInTheQuery()
INTERNAL: There are cases (which we might want to eliminate?) |
boolean |
equals(java.lang.Object expression)
INTERNAL: Return if the expression is equal to the other. |
org.eclipse.persistence.internal.helper.DatabaseTable |
getAliasedViewTable()
INTERNAL: |
ExpressionBuilder |
getBuilder()
INTERNAL: Return the expression builder which is the ultimate base of this expression, or null if there isn't one (shouldn't happen if we start from a root) |
ClassDescriptor |
getDescriptor()
INTERNAL: Only usable after the session and class have been set. |
java.lang.Class |
getQueryClass()
INTERNAL: |
org.eclipse.persistence.internal.sessions.AbstractSession |
getSession()
INTERNAL: |
org.eclipse.persistence.internal.expressions.SQLSelectStatement |
getStatement()
INTERNAL: Return the statement that expression is for. |
org.eclipse.persistence.internal.helper.DatabaseTable |
getViewTable()
INTERNAL: |
boolean |
hasViewTable()
INTERNAL: |
boolean |
isExpressionBuilder()
INTERNAL: |
Expression |
normalize(org.eclipse.persistence.internal.expressions.ExpressionNormalizer normalizer)
INTERNAL: Normalize the expression into a printable structure. |
void |
printJava(org.eclipse.persistence.internal.expressions.ExpressionJavaPrinter printer)
INTERNAL: Print java |
Expression |
rebuildOn(Expression newBase)
INTERNAL: This expression is built on a different base than the one we want. |
protected Expression |
registerIn(java.util.Map alreadyDone)
INTERNAL: Override Expression.registerIn to check if the new base expression has already been provided for the clone. |
void |
resetPlaceHolderBuilder(ExpressionBuilder queryBuilder)
INTERNAL: Search the tree for any expressions (like SubSelectExpressions) that have been built using a builder that is not attached to the query. |
void |
setQueryClass(java.lang.Class queryClass)
INTERNAL: Set the class which this node represents. |
void |
setQueryClassAndDescriptor(java.lang.Class queryClass,
ClassDescriptor descriptor)
INTERNAL: Set the class and descriptor which this node represents. |
void |
setSession(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Set the session in which we expect this expression to be translated. |
void |
setStatement(org.eclipse.persistence.internal.expressions.SQLSelectStatement statement)
INTERNAL: Set the statement that expression is for. |
void |
setViewTable(org.eclipse.persistence.internal.helper.DatabaseTable theTable)
INTERNAL: This expression represents something read through a view table. |
void |
setWasAdditionJoinCriteriaUsed(boolean joinCriteriaUsed)
INTERNAL: If the additional Join Criteria for the class this builder represents has been added to the statement then mark this as true. |
Expression |
twistedForBaseAndContext(Expression newBase,
Expression context)
INTERNAL: Rebuild myself against the base, with the values of parameters supplied by the context expression. |
java.lang.Object |
valueFromObject(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.sessions.AbstractRecord translationRow,
int valueHolderPolicy,
boolean isObjectUnregistered)
INTERNAL: The expression builder represent the entire object, just return it. |
boolean |
wasAdditionJoinCriteriaUsed()
INTERNAL: If the additional Join Criteria for the class this builder represents has been added to the statement this method will return true; |
boolean |
wasQueryClassSetInternally()
INTERNAL: Returns true if TopLink set the query class as opposed to the customer. |
void |
writeDescriptionOn(java.io.BufferedWriter writer)
INTERNAL: For debug printing purposes. |
Methods inherited from class org.eclipse.persistence.internal.expressions.ObjectExpression |
---|
addDerivedExpression, additionalExpressionCriteria, additionalExpressionCriteriaMap, anyOf, anyOfAllowingNone, derivedExpressionNamed, derivedManualExpressionNamed, doNotUseOuterJoin, doUseOuterJoin, existingDerivedExpressionNamed, get, getAllowingNull, getFields, getForUpdateOfFields, getManualQueryKey, getOwnedTables, hasDerivedExpressions, isObjectExpression, isUsingOuterJoinForMultitableInheritance, newDerivedExpressionNamed, newManualDerivedExpressionNamed, postCopyIn, postCopyIn, setShouldUseOuterJoinForMultitableInheritance, shouldUseOuterJoin, shouldUseOuterJoinForMultitableInheritance, type, writeForUpdateOfFields |
Methods inherited from class org.eclipse.persistence.internal.expressions.DataExpression |
---|
addDerivedField, addDerivedTable, asOf, assignAlias, assignAlias, clearAliases, copyCollection, existingDerivedField, existingDerivedTable, getAdditionalTables, getAliasedField, getAsOfClause, getField, getField, getField, getMapping, getQueryKeyOrNull, getTable, getTable, getTableAliases, hasAsOfClause, hasBeenAliased, hasBeenNormalized, hasDerivedFields, hasDerivedTables, isAttribute, isDataExpression, iterateOn, mappingCriteria, newDerivedField, newDerivedTable, printSQL, setHasBeenNormalized, setTableAliases, tableAliasesDescription, writeSubexpressionsTo |
Methods inherited from class org.eclipse.persistence.internal.expressions.BaseExpression |
---|
getBaseExpression, setBaseExpression, shallowClone |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected transient org.eclipse.persistence.internal.sessions.AbstractSession session
protected java.lang.Class queryClass
protected org.eclipse.persistence.internal.expressions.SQLSelectStatement statement
protected org.eclipse.persistence.internal.helper.DatabaseTable viewTable
protected org.eclipse.persistence.internal.helper.DatabaseTable aliasedViewTable
protected boolean wasQueryClassSetInternally
protected boolean wasAdditionJoinCriteriaUsed
Constructor Detail |
---|
public ExpressionBuilder()
public ExpressionBuilder(java.lang.Class queryClass)
Method Detail |
---|
public boolean equals(java.lang.Object expression)
equals
in class org.eclipse.persistence.internal.expressions.ObjectExpression
public org.eclipse.persistence.internal.helper.DatabaseTable aliasForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
aliasForTable
in class org.eclipse.persistence.internal.expressions.DataExpression
public int assignTableAliasesStartingAt(int initialValue)
assignTableAliasesStartingAt
in class Expression
public java.lang.String descriptionOfNodeType()
descriptionOfNodeType
in class Expression
public boolean doesNotRepresentAnObjectInTheQuery()
public org.eclipse.persistence.internal.helper.DatabaseTable getAliasedViewTable()
public ExpressionBuilder getBuilder()
getBuilder
in class org.eclipse.persistence.internal.expressions.BaseExpression
public ClassDescriptor getDescriptor()
getDescriptor
in class org.eclipse.persistence.internal.expressions.ObjectExpression
public java.lang.Class getQueryClass()
public org.eclipse.persistence.internal.sessions.AbstractSession getSession()
getSession
in class Expression
public org.eclipse.persistence.internal.expressions.SQLSelectStatement getStatement()
public org.eclipse.persistence.internal.helper.DatabaseTable getViewTable()
public boolean hasViewTable()
public boolean isExpressionBuilder()
isExpressionBuilder
in class Expression
public Expression normalize(org.eclipse.persistence.internal.expressions.ExpressionNormalizer normalizer)
normalize
in class org.eclipse.persistence.internal.expressions.DataExpression
public void printJava(org.eclipse.persistence.internal.expressions.ExpressionJavaPrinter printer)
printJava
in class Expression
public Expression rebuildOn(Expression newBase)
rebuildOn
in class Expression
Expression.cloneUsing(Expression newBase)
public void resetPlaceHolderBuilder(ExpressionBuilder queryBuilder)
resetPlaceHolderBuilder
in class org.eclipse.persistence.internal.expressions.BaseExpression
protected Expression registerIn(java.util.Map alreadyDone)
registerIn
in class Expression
Expression.cloneUsing(Expression)
public void setQueryClass(java.lang.Class queryClass)
public void setQueryClassAndDescriptor(java.lang.Class queryClass, ClassDescriptor descriptor)
public void setSession(org.eclipse.persistence.internal.sessions.AbstractSession session)
public void setStatement(org.eclipse.persistence.internal.expressions.SQLSelectStatement statement)
public void setViewTable(org.eclipse.persistence.internal.helper.DatabaseTable theTable)
public void setWasAdditionJoinCriteriaUsed(boolean joinCriteriaUsed)
public Expression twistedForBaseAndContext(Expression newBase, Expression context)
twistedForBaseAndContext
in class Expression
newBase
- context
-
public java.lang.Object valueFromObject(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered)
valueFromObject
in class Expression
isObjectUnregistered
- true if object possibly not a clone, but is being
conformed against the unit of work cache.public boolean wasAdditionJoinCriteriaUsed()
public boolean wasQueryClassSetInternally()
public void writeDescriptionOn(java.io.BufferedWriter writer) throws java.io.IOException
writeDescriptionOn
in class Expression
java.io.IOException
|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |