|
EclipseLink 1.0_1.0M2 API Reference - Incubation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectObjectExpression
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
Field Summary | |
---|---|
protected DatabaseTable |
aliasedViewTable
|
protected java.lang.Class |
queryClass
|
protected AbstractSession |
session
|
protected SQLSelectStatement |
statement
|
protected DatabaseTable |
viewTable
|
protected boolean |
wasAdditionJoinCriteriaUsed
|
protected boolean |
wasQueryClassSetInternally
|
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 | |
---|---|
DatabaseTable |
aliasForTable(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. |
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: |
AbstractSession |
getSession()
INTERNAL: |
SQLSelectStatement |
getStatement()
INTERNAL: Return the statement that expression is for. |
DatabaseTable |
getViewTable()
INTERNAL: |
boolean |
hasViewTable()
INTERNAL: |
boolean |
isExpressionBuilder()
INTERNAL: |
Expression |
normalize(ExpressionNormalizer normalizer)
INTERNAL: Normalize the expression into a printable structure. |
void |
printJava(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.Dictionary alreadyDone)
INTERNAL: Override Expression.registerIn to check if the new base expression has already been provided for the clone. |
void |
setQueryClass(java.lang.Class queryClass)
INTERNAL: Set the class which this node represents. |
void |
setSession(AbstractSession session)
INTERNAL: Set the session in which we expect this expression to be translated. |
void |
setStatement(SQLSelectStatement statement)
INTERNAL: Set the statement that expression is for. |
void |
setViewTable(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,
AbstractSession session,
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 appoased to the customer. |
void |
writeDescriptionOn(java.io.BufferedWriter writer)
INTERNAL: For debug printing purposes. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient AbstractSession session
protected java.lang.Class queryClass
protected SQLSelectStatement statement
protected DatabaseTable viewTable
protected 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)
public DatabaseTable aliasForTable(DatabaseTable table)
public int assignTableAliasesStartingAt(int initialValue)
public java.lang.String descriptionOfNodeType()
public boolean doesNotRepresentAnObjectInTheQuery()
public DatabaseTable getAliasedViewTable()
public ExpressionBuilder getBuilder()
public ClassDescriptor getDescriptor()
public java.lang.Class getQueryClass()
public AbstractSession getSession()
public SQLSelectStatement getStatement()
public DatabaseTable getViewTable()
public boolean hasViewTable()
public boolean isExpressionBuilder()
public Expression normalize(ExpressionNormalizer normalizer)
public void printJava(ExpressionJavaPrinter printer)
public Expression rebuildOn(Expression newBase)
protected Expression registerIn(java.util.Dictionary alreadyDone)
Expression.cloneUsing(Expression)
public void setQueryClass(java.lang.Class queryClass)
public void setSession(AbstractSession session)
public void setStatement(SQLSelectStatement statement)
public void setViewTable(DatabaseTable theTable)
public void setWasAdditionJoinCriteriaUsed(boolean joinCriteriaUsed)
public Expression twistedForBaseAndContext(Expression newBase, Expression context)
newBase
- context
-
public java.lang.Object valueFromObject(java.lang.Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered)
public boolean wasAdditionJoinCriteriaUsed()
public boolean wasQueryClassSetInternally()
public void writeDescriptionOn(java.io.BufferedWriter writer) throws java.io.IOException
java.io.IOException
|
EclipseLink 1.0_1.0M2 API Reference - Incubation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |