Top Description Fields Constructors Methods
org.eclipse.persistence.internal.expressions

public Class ConstantExpression

extends Expression
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.expressions.DateConstantExpression, org.eclipse.persistence.internal.expressions.CollectionExpression
Imports
java.io.BufferedWriter, .IOException, java.util.Collection, .List, .Map, org.eclipse.persistence.expressions.Expression, .ExpressionBuilder, org.eclipse.persistence.internal.helper.DatabaseField, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession

Used for wrapping constant values.

Field Summary

Modifier and TypeField and Description
protected Boolean
protected Expression
protected Object
Inherited from org.eclipse.persistence.expressions.Expression:
currentAliashashCodelastTableselectIfOrderedByshouldUseUpperCaseForIgnoreCase

Constructor Summary

AccessConstructor and Description
public
public
ConstantExpression(Object newValue, Expression baseExpression)

Method Summary

Modifier and TypeMethod and Description
public Boolean
canBind()

INTERNAL: true indicates this expression can bind parameters false indicates this expression cannot bind parameters Defaults to null to indicate no specific preference

public int
computeHashCode()

Overrides org.eclipse.persistence.expressions.Expression.computeHashCode.

INTERNAL: Compute a consistent hash-code for the expression.
public String
public boolean
equals(Object
the reference object with which to compare.
object
)

Overrides org.eclipse.persistence.expressions.Expression.equals.

INTERNAL: Return if the expression is equal to the other.
public ExpressionBuilder
getBuilder()

Implements abstract org.eclipse.persistence.expressions.Expression.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)
public Expression
public Object
public boolean
public boolean
public Expression
normalize(ExpressionNormalizer normalizer)

Overrides org.eclipse.persistence.expressions.Expression.normalize.

INTERNAL: Normalize collection of values if they are expressions.
private void
normalizeValueList(ExpressionNormalizer normalizer, Collection<E> valueCollection)

protected void
postCopyIn(Map<K, V> alreadyDone)

Overrides org.eclipse.persistence.expressions.Expression.postCopyIn.

INTERNAL: Used for cloning.
public void
printJava(ExpressionJavaPrinter printer)

Overrides org.eclipse.persistence.expressions.Expression.printJava.

INTERNAL: Print java for project class generation
public void
printSQL(ExpressionSQLPrinter printer)

Implements abstract org.eclipse.persistence.expressions.Expression.printSQL.

INTERNAL: Print SQL onto the stream, using the ExpressionPrinter for context
public Expression
rebuildOn(Expression newBase)

Implements abstract org.eclipse.persistence.expressions.Expression.rebuildOn.

INTERNAL: This expression is built on a different base than the one we want.
public void
resetPlaceHolderBuilder(ExpressionBuilder queryBuilder)

Implements abstract org.eclipse.persistence.expressions.Expression.resetPlaceHolderBuilder.

INTERNAL: Search the tree for any expressions (like SubSelectExpressions) that have been built using a builder that is not attached to the query.
public void
setCanBind(Boolean canBind)

INTERNAL: Set to true if this expression can bind parameters Set to false if this expression cannot bind parameters Set to null to indicate no specific preference

public void
setLocalBase(Expression e)

Overrides org.eclipse.persistence.expressions.Expression.setLocalBase.

INTERNAL: Set the local base expression, ie the one on the other side of the operator Most types will ignore this, since they don't need it.
public void
public Expression
twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)

Overrides org.eclipse.persistence.expressions.Expression.twistedForBaseAndContext.

INTERNAL: Rebuild myself against the base, with the values of parameters supplied by the context expression.
public Object
valueFromObject(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean
true if object possibly not a clone, but is being conformed against the unit of work cache.
isObjectUnregistered
)

Overrides org.eclipse.persistence.expressions.Expression.valueFromObject.

INTERNAL: Return the value for in memory comparison.
public void
writeDescriptionOn(BufferedWriter writer)

Overrides org.eclipse.persistence.expressions.Expression.writeDescriptionOn.

INTERNAL: Used to print a debug form of the expression tree.
public void
writeFields(ExpressionSQLPrinter printer, List<DatabaseField> newFields, SQLSelectStatement statement)

Overrides org.eclipse.persistence.expressions.Expression.writeFields.

INTERNAL: Append the constant value into the printer
Inherited from org.eclipse.persistence.expressions.Expression:
addDateaddDateaddMonthsaddMonthsaliasaliasForTableallallallallallallallallallallallallallOfandanyanyanyanyanyanyanyanyanyanyanyanyanyOfanyOfanyOfAllowingNoneanyOfAllowingNoneasascendingasciiValueasOfassignAliasassignTableAliasesStartingAtaveragebetweenbetweenbetweenbetweenbetweenbetweenbetweenbetweenbetweencaseConditionStatementcaseConditionStatementcaseStatementcaseStatementcastclonecloneUsingcoalescecoalesceconcatcontainsAllKeyWordscontainsAnyKeyWordscontainsSubstringcontainsSubstringcontainsSubstringIgnoringCasecontainsSubstringIgnoringCaseconvertNodeToUseOuterJoinconvertToUseOuterJoincopiedVersionFromcountcreatecreatecreateWithBaseLastcurrentDatecurrentDateDatecurrentTimecurrentTimeStampdateDifferencedateDifferencedateNamedatePartdateToStringdecodedescendingdifferencedistinctdoesConformdoesConformequalequalequalequalequalequalequalequalequalequalequalOuterJoinequalOuterJoinequalsIgnoreCaseequalsIgnoreCaseexceptexceptexceptAllexceptAllexistsexistsNodeextractextractFieldsextractPrimaryKeyValuesextractValueextractValuesextractXmlfromfromConstantfromLiteralgetgetgetAliasgetAllowingNullgetAsOfClausegetAsOfClauseRecursivelygetClonedFieldgetFieldgetFieldgetFieldsgetFieldValuegetFunctiongetFunctiongetFunctiongetFunctiongetFunctionWithArgumentsgetLeafDescriptorgetLeafMappinggetNamegetNumberValgetOperatorgetOperatorgetOwnedTablesgetParametergetParametergetParametergetPropertygetSelectionFieldsgetSelectionFieldsgetSessiongetStringValgetTablegetTablegetTableAliasesgreaterThangreaterThangreaterThangreaterThangreaterThangreaterThangreaterThangreaterThangreaterThangreaterThangreaterThanEqualgreaterThanEqualgreaterThanEqualgreaterThanEqualgreaterThanEqualgreaterThanEqualgreaterThanEqualgreaterThanEqualgreaterThanEqualgreaterThanEqualhasAsOfClausehasBeenAliasedhashCodehexToRawifNullininininininininininininindexindexOfintersectintersectintersectAllintersectAllisClassTypeExpressionisCompoundExpressionisDataExpressionisEmptyisExpressionBuilderisFieldExpressionisFragmentisFunctionExpressionisLiteralExpressionisLogicalExpressionisMapEntryExpressionisNullisObjectExpressionisParameterExpressionisQueryKeyExpressionisRelationExpressionisSubSelectExpressionisTableExpressionisTreatExpressioniterateOnjoinlastDayleftJoinleftPadleftPadleftTrimleftTrimlengthlessThanlessThanlessThanlessThanlessThanlessThanlessThanlessThanlessThanlessThanlessThanEquallessThanEquallessThanEquallessThanEquallessThanEquallessThanEquallessThanEquallessThanEquallessThanEquallessThanEquallikelikelikelikelikeIgnoreCaselikeIgnoreCaseliterallocalDatelocalDateTimelocalTimelocatelocatelocatemapEntrymapKeymaximumminimummonthsBetweennewTimenextDaynoneOfnotnotBetweennotBetweennotBetweennotBetweennotBetweennotBetweennotBetweennotBetweennotBetweennotEmptynotEqualnotEqualnotEqualnotEqualnotEqualnotEqualnotEqualnotEqualnotEqualnotEqualnotExistsnotInnotInnotInnotInnotInnotInnotInnotInnotInnotInnotInnotInnotLikenotLikenotLikenotLikenotNullnullIfnullsFirstnullsLastoperatororperformOperatorpostfixSQLprefixSQLrefregexpregexpregisterInreplacereplicatereplicateresetCachereverserightrightrightPadrightPadrightTrimrightTrimroundDateselectIfOrderedBysetSelectIfOrderedByshallowClonesizesizesomesomesomesomesomesomesomesomesomesomesomesomesqlstandardDeviationsubQuerysubstringsubstringsubstringsubstringsumtoChartoChartoCharactertoDatetoLowerCasetoNumbertoStringtoStringtoUpperCasetoUppercaseCasedWordstranslatetreattrimtrimtruncateDatetwisttypeunionunionunionAllunionAllvalidateNodevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalueFromObjectvariancewriteAliaswriteFieldwriteSubexpressionsTo

Field Detail

canBindback to summary
protected Boolean canBind
localBaseback to summary
protected Expression localBase
valueback to summary
protected Object value

Constructor Detail

ConstantExpressionback to summary
public ConstantExpression()
ConstantExpressionback to summary
public ConstantExpression(Object newValue, Expression baseExpression)

Method Detail

canBindback to summary
public Boolean canBind()

INTERNAL: true indicates this expression can bind parameters false indicates this expression cannot bind parameters Defaults to null to indicate no specific preference

computeHashCodeback to summary
public int computeHashCode()

Overrides org.eclipse.persistence.expressions.Expression.computeHashCode.

INTERNAL: Compute a consistent hash-code for the expression. This is used to allow dynamic expression's SQL to be cached.

Annotations
@Override
descriptionOfNodeTypeback to summary
public String descriptionOfNodeType()

Overrides org.eclipse.persistence.expressions.Expression.descriptionOfNodeType.

INTERNAL: Used for debug printing.

Annotations
@Override
equalsback to summary
public boolean equals(Object object)

Overrides org.eclipse.persistence.expressions.Expression.equals.

INTERNAL: Return if the expression is equal to the other. This is used to allow dynamic expression's SQL to be cached.

Parameters
object:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getBuilderback to summary
public ExpressionBuilder getBuilder()

Implements abstract org.eclipse.persistence.expressions.Expression.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)

Annotations
@Override
getLocalBaseback to summary
public Expression getLocalBase()
getValueback to summary
public Object getValue()
isConstantExpressionback to summary
public boolean isConstantExpression()

Overrides org.eclipse.persistence.expressions.Expression.isConstantExpression.

Doc from org.eclipse.persistence.expressions.Expression.isConstantExpression.

INTERNAL:

Annotations
@Override
isValueExpressionback to summary
public boolean isValueExpression()

Overrides org.eclipse.persistence.expressions.Expression.isValueExpression.

INTERNAL:

Annotations
@Override
normalizeback to summary
public Expression normalize(ExpressionNormalizer normalizer)

Overrides org.eclipse.persistence.expressions.Expression.normalize.

INTERNAL: Normalize collection of values if they are expressions. or collection of collection expressions.

Annotations
@Override
normalizeValueListback to summary
private void normalizeValueList(ExpressionNormalizer normalizer, Collection<E> valueCollection)
postCopyInback to summary
protected void postCopyIn(Map<K, V> alreadyDone)

Overrides org.eclipse.persistence.expressions.Expression.postCopyIn.

INTERNAL: Used for cloning.

Annotations
@Override
printJavaback to summary
public void printJava(ExpressionJavaPrinter printer)

Overrides org.eclipse.persistence.expressions.Expression.printJava.

INTERNAL: Print java for project class generation

Annotations
@Override
printSQLback to summary
public void printSQL(ExpressionSQLPrinter printer)

Implements abstract org.eclipse.persistence.expressions.Expression.printSQL.

INTERNAL: Print SQL onto the stream, using the ExpressionPrinter for context

Annotations
@Override
rebuildOnback to summary
public Expression rebuildOn(Expression newBase)

Implements abstract org.eclipse.persistence.expressions.Expression.rebuildOn.

INTERNAL: This expression is built on a different base than the one we want. Rebuild it and return the root of the new tree

Annotations
@Override
resetPlaceHolderBuilderback to summary
public void resetPlaceHolderBuilder(ExpressionBuilder queryBuilder)

Implements abstract org.eclipse.persistence.expressions.Expression.resetPlaceHolderBuilder.

INTERNAL: Search the tree for any expressions (like SubSelectExpressions) that have been built using a builder that is not attached to the query. This happens in case of an Exists call using a new ExpressionBuilder(). This builder needs to be replaced with one from the query.

Annotations
@Override
setCanBindback to summary
public void setCanBind(Boolean canBind)

INTERNAL: Set to true if this expression can bind parameters Set to false if this expression cannot bind parameters Set to null to indicate no specific preference

setLocalBaseback to summary
public void setLocalBase(Expression e)

Overrides org.eclipse.persistence.expressions.Expression.setLocalBase.

Doc from org.eclipse.persistence.expressions.Expression.setLocalBase.

INTERNAL: Set the local base expression, ie the one on the other side of the operator Most types will ignore this, since they don't need it.

Annotations
@Override
setValueback to summary
public void setValue(Object value)
twistedForBaseAndContextback to summary
public Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)

Overrides org.eclipse.persistence.expressions.Expression.twistedForBaseAndContext.

INTERNAL: Rebuild myself against the base, with the values of parameters supplied by the context expression. This is used for transforming a standalone expression (e.g. the join criteria of a mapping) into part of some larger expression. You normally would not call this directly, instead calling twist See the comment there for more details"

Annotations
@Override
valueFromObjectback to summary
public Object valueFromObject(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered)

Overrides org.eclipse.persistence.expressions.Expression.valueFromObject.

INTERNAL: Return the value for in memory comparison. This is only valid for valueable expressions.

Parameters
isObjectUnregistered:boolean

Doc from org.eclipse.persistence.expressions.Expression.valueFromObject.

true if object possibly not a clone, but is being conformed against the unit of work cache.

Annotations
@Override
writeDescriptionOnback to summary
public void writeDescriptionOn(BufferedWriter writer) throws IOException

Overrides org.eclipse.persistence.expressions.Expression.writeDescriptionOn.

INTERNAL: Used to print a debug form of the expression tree.

Annotations
@Override
writeFieldsback to summary
public void writeFields(ExpressionSQLPrinter printer, List<DatabaseField> newFields, SQLSelectStatement statement)

Overrides org.eclipse.persistence.expressions.Expression.writeFields.

INTERNAL: Append the constant value into the printer

Annotations
@Override