public abstract class DataExpression extends Expression
Modifier and Type | Field and Description |
---|---|
protected Expression |
baseExpression |
protected Vector |
derivedFields |
protected Vector |
derivedTables |
protected boolean |
hasBeenNormalized |
protected TableAliasLookup |
tableAliases |
currentAlias, lastTable, selectIfOrderedBy
Constructor and Description |
---|
DataExpression()
DataExpression constructor comment.
|
Modifier and Type | Method and Description |
---|---|
void |
addDerivedField(Expression addThis) |
void |
addDerivedTable(Expression addThis) |
DatabaseTable |
aliasForTable(DatabaseTable table)
INTERNAL:
Find the alias for a given table
|
protected void |
assignAlias(DatabaseTable alias,
DatabaseTable table)
INTERNAL:
Alias a particular table within this node
|
protected void |
assignAlias(String name,
DatabaseTable table)
INTERNAL:
Alias a particular table within this node
|
void |
clearAliases()
INTERNAL:
|
Vector |
copyCollection(Vector in,
Dictionary alreadyDone) |
Expression |
existingDerivedField(DatabaseField field)
INTERNAL:
|
Expression |
existingDerivedTable(DatabaseTable table)
INTERNAL:
|
DatabaseField |
getAliasedField()
INTERNAL:
Return the field appropriately aliased
|
Expression |
getBaseExpression() |
ExpressionBuilder |
getBuilder()
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() |
DatabaseField |
getField()
INTERNAL:
|
Expression |
getField(DatabaseField field)
ADVANCED: Return an expression representing a field in a data-level query.
|
Expression |
getField(String fieldName)
ADVANCED:
Return an expression representing a field in a data-level query.
|
DatabaseMapping |
getMapping() |
Vector |
getOwnedTables()
INTERNAL:
|
QueryKey |
getQueryKeyOrNull() |
Expression |
getTable(DatabaseTable table)
ADVANCED: Return an expression representing a table in a data-level query.
|
Expression |
getTable(String tableName)
ADVANCED: Return an expression representing a table in a data-level query.
|
TableAliasLookup |
getTableAliases()
INTERNAL:
Return the aliases used.
|
boolean |
hasBeenAliased()
INTERNAL:
Answers if the database tables associated with this expression have been
aliased.
|
boolean |
hasBeenNormalized()
INTERNAL:
Did the normalizer already add additional joins to the where clause due to
this query key representing a foreign reference mapping?
This insures that join criteria (for any query key expression) is not
added twice.
|
protected boolean |
hasDerivedFields() |
protected boolean |
hasDerivedTables() |
boolean |
isAttribute()
INTERNAL:
|
boolean |
isDataExpression()
INTERNAL:
|
void |
iterateOn(ExpressionIterator iterator)
INTERNAL:
For iterating using an inner class
|
Expression |
mappingCriteria() |
Expression |
newDerivedField(DatabaseField field)
INTERNAL:
|
Expression |
newDerivedTable(DatabaseTable table)
INTERNAL:
|
Expression |
normalize(ExpressionNormalizer normalizer)
INTERNAL:
Normalize the expression into a printable structure.
|
protected void |
postCopyIn(Dictionary alreadyDone)
INTERNAL:
Used for cloning.
|
void |
printSQL(ExpressionSQLPrinter printer)
INTERNAL:
Print SQL onto the stream, using the ExpressionPrinter for context
|
protected void |
setBaseExpression(Expression e) |
void |
setHasBeenNormalized(boolean value) |
void |
setTableAliases(TableAliasLookup tableAliases)
INTERNAL:
For CR#2456, Table identity involves having two tables sharing the same
aliasing table.
|
String |
tableAliasesDescription() |
void |
writeSubexpressionsTo(BufferedWriter writer,
int indent)
Print the base for debuggin purposes.
|
addDate, addDate, addMonths, addMonths, all, all, all, all, all, all, all, all, all, all, all, all, allOf, and, any, any, any, any, any, any, any, any, any, any, any, any, anyOf, anyOfAllowingNone, ascending, asciiValue, assignTableAliasesStartingAt, average, between, between, between, between, between, between, between, between, between, caseStatement, clone, cloneUsing, concat, containsAllKeyWords, containsAnyKeyWords, containsSubstring, containsSubstring, containsSubstringIgnoringCase, containsSubstringIgnoringCase, convertNodeToUseOuterJoin, convertToUseOuterJoin, copiedVersionFrom, count, create, create, createWithBaseLast, currentDate, currentDateDate, currentTime, currentTimeStamp, dateDifference, dateDifference, dateName, datePart, dateToString, decode, descending, descriptionOfNodeType, detectExpression, difference, distinct, doesConform, doesConform, equal, equal, equal, equal, equal, equal, equal, equal, equal, equal, equalOuterJoin, equalOuterJoin, equalsIgnoreCase, equalsIgnoreCase, exists, existsNode, extract, extractPrimaryKeyValues, extractValue, from, fromConstant, fromLiteral, get, get, getAllowingNull, getAllowingNull, getClonedField, getFields, getFieldValue, getFunction, getFunction, getFunction, getFunction, getFunctionWithArguments, getName, getNumberVal, getOperator, getOperator, getParameter, getParameter, getParameter, getSession, getStringVal, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, hasAsOfClause, hexToRaw, ifNull, in, in, in, in, in, in, in, in, in, in, in, in, indexOf, isCompoundExpression, isConstantExpression, isEmpty, isExpressionBuilder, isFieldExpression, isFragment, isFunctionExpression, isLiteralExpression, isLogicalExpression, isNull, isObjectExpression, isParameterExpression, isQueryKeyExpression, isRelationExpression, isTableExpression, isValueExpression, lastDay, leftPad, leftPad, leftTrim, leftTrim, length, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, like, like, like, like, likeIgnoreCase, likeIgnoreCase, literal, locate, locate, locate, maximum, minimum, monthsBetween, newTime, nextDay, noneOf, not, notBetween, notBetween, notBetween, notBetween, notBetween, notBetween, notBetween, notBetween, notBetween, notEmpty, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notExists, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notLike, notLike, notNull, or, performOperator, postfixSQL, prefixSQL, printJava, printSQLWithoutConversion, rebuildOn, ref, registerIn, replace, replicate, replicate, resetCache, reverse, right, right, rightPad, rightPad, rightTrim, rightTrim, roundDate, selectIfOrderedBy, setLocalBase, setSelectIfOrderedBy, shallowClone, size, some, some, some, some, some, some, some, some, some, some, some, some, standardDeviation, subQuery, substring, substring, sum, toChar, toChar, toCharacter, toDate, toLowerCase, toNumber, toString, toString, toUpperCase, toUppercaseCasedWords, translate, trim, trim, truncateDate, twist, twistedForBaseAndContext, validateNode, value, value, value, value, value, value, value, value, value, value, valueFromObject, valueFromObject, variance, writeDescriptionOn, writeField, writeFields
protected Vector derivedTables
protected Vector derivedFields
protected Expression baseExpression
protected boolean hasBeenNormalized
protected TableAliasLookup tableAliases
public void addDerivedField(Expression addThis)
public void addDerivedTable(Expression addThis)
public DatabaseTable aliasForTable(DatabaseTable table)
aliasForTable
in class Expression
protected void assignAlias(String name, DatabaseTable table)
assignAlias
in class Expression
protected void assignAlias(DatabaseTable alias, DatabaseTable table)
public void clearAliases()
public Vector copyCollection(Vector in, Dictionary alreadyDone)
public Expression existingDerivedField(DatabaseField field)
public Expression existingDerivedTable(DatabaseTable table)
public DatabaseField getAliasedField()
public Expression getBaseExpression()
public ExpressionBuilder getBuilder()
getBuilder
in class Expression
public ClassDescriptor getDescriptor()
public DatabaseField getField()
public Expression getField(String fieldName)
Expression
Example:
builder.getField("ADDR_ID").greaterThan(100); builder.getTable("PROJ_EMP").getField("TYPE").equal("S");
getField
in class Expression
public Expression getField(DatabaseField field)
Expression
Example:
builder.getField(aField).greaterThan(100);
getField
in class Expression
public DatabaseMapping getMapping()
public Vector getOwnedTables()
getOwnedTables
in class Expression
public QueryKey getQueryKeyOrNull()
public Expression getTable(String tableName)
Expression
Example:
builder.getTable("PROJ_EMP").getField("TYPE").equal("S");
getTable
in class Expression
public Expression getTable(DatabaseTable table)
Expression
Example:
builder.getTable(linkTable).getField("TYPE").equal("S");
getTable
in class Expression
public TableAliasLookup getTableAliases()
getTableAliases
in class Expression
public boolean hasBeenNormalized()
New meaning: DataExpressions are often iterated on multiple times during normalize, but Function/Relation expressions only once. Adding a has been normalized flag improves performance and is required in some applications, such as have temporal query criteria been added.
public boolean hasBeenAliased()
Expression
hasBeenAliased
in class Expression
protected boolean hasDerivedFields()
protected boolean hasDerivedTables()
public boolean isAttribute()
public boolean isDataExpression()
Expression
isDataExpression
in class Expression
public void iterateOn(ExpressionIterator iterator)
iterateOn
in class Expression
public Expression mappingCriteria()
public Expression newDerivedField(DatabaseField field)
public Expression newDerivedTable(DatabaseTable table)
public Expression normalize(ExpressionNormalizer normalizer)
normalize
in class Expression
protected void postCopyIn(Dictionary alreadyDone)
postCopyIn
in class Expression
public void printSQL(ExpressionSQLPrinter printer)
printSQL
in class Expression
protected void setBaseExpression(Expression e)
public void setHasBeenNormalized(boolean value)
public void setTableAliases(TableAliasLookup tableAliases)
public String tableAliasesDescription()
public void writeSubexpressionsTo(BufferedWriter writer, int indent) throws IOException
writeSubexpressionsTo
in class Expression
IOException
Copyright © 2021. All rights reserved.