Class AbstractScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.model.AbstractStateObjectBuilder
org.eclipse.persistence.jpa.jpql.tools.model.AbstractScalarExpressionStateObjectBuilder<T>
- All Implemented Interfaces:
 IScalarExpressionStateObjectBuilder<T>
- Direct Known Subclasses:
 AbstractConditionalExpressionStateObjectBuilder,AbstractNewValueStateObjectBuilder,AbstractSelectExpressionStateObjectBuilder,AbstractSimpleSelectExpressionStateObjectBuilder
public abstract class AbstractScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
extends AbstractStateObjectBuilder
implements IScalarExpressionStateObjectBuilder<T>
This abstract definition of a builder provides the support for creating expressions defined by a
 
scalar expression.- Since:
 - 2.4
 - Version:
 - 2.4
 
- 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a newAbstractScalarExpressionStateObjectBuilder. - 
Method Summary
Modifier and TypeMethodDescriptionCreates the expressionABS(x).Creates the expressionx + y.protected voidarithmetic(boolean plusSign) protected voidCreates the expressionAVG(path).avgDistinct(String path) Creates the expressionAVG(DISTINCT path).protected StateObjectbuildCollectionPath(String path) protected StateObjectbuildIdentificationVariable(String literal) protected StateObjectbuildInputParameter(String parameter) protected StateObjectbuildNumeric(Number number) protected StateObjectbuildNumeric(String number) protected StateObjectbuildStateFieldPath(String path) protected StateObjectbuildStringLiteral(String literal) case_(ICaseExpressionStateObjectBuilder builder) Creates a newCASEexpression.Create the expressionCOALESCE(scalar_expression {, scalar_expression}+).Create the expressionCOALESCE(scalar_expression {, scalar_expression}+).Creates the expressionCONCAT(string_primary, string_primary {, string_primary}*).Creates the expressionCONCAT(string_primary, string_primary {, string_primary}*).protected voidCreates the expressionCOUNT(identification_variable | state_field_path_expression | single_valued_object_path_expression).countDistinct(String path) Creates the expressionCOUNT(DISTINCT identification_variable | state_field_path_expression | single_valued_object_path_expression).Creates the expression representingCURRENT_DATE.Creates the expression representingCURRENT_TIME.Creates the expression representingCURRENT_TIMESTAMP.Creates a new date using the JDBC syntax of a date.Creates the expressionx / y.entityType(String entityTypeName) Creates a new entity type literal.enumLiteral(Enum<? extends Enum<?>> enumConstant) Creates a new enum literal.Creates the expression<identifier>('functionName' {, expression}*).Creates the expression<identifier>('functionName' {, expression}*).Creates the expression<identifier>('functionName' {, expression}*).Returns the builder that can create aCASEexpression, which requires aIConditionalExpressionStateObjectBuilderto build theWHENclauses.protected StateObjectReturns the parent of the expression to build, which is only required when a JPQL fragment needs to be parsed.Creates the expressionINDEX(identification_variable).Creates the expressionLENGTH(expression).protected StateObjectprotected List<StateObject> Creates the expressionLOCATE(string_primary, string_primary).Creates the expressionLOCATE(string_primary, string_primary [, simple_arithmetic_expression]).protected voidCreates the expressionMAX(path).maxDistinct(String path) Creates the expressionMAX(DISTINCT path).protected voidCreates the expressionAVG(path).minDistinct(String path) Creates the expressionAVG(DISTINCT path).Creates the expression- x.Creates the expressionMOD(simple_arithmetic_expression, simple_arithmetic_expression).Creates the expressionx * y.Create the expressionNULLIF(scalar_expression, scalar_expression).Creates the numeric literal.Creates the numeric literal.Creates the input parameter.Creates a new state field path expression.Creates the expression+ x.Creates the expressionSIZE(collection_valued_path_expression).Creates the expressionSQRT(x).protected List<StateObject> stateObjects(int count) Returns a list of theStateObjectsthat were previously created.protected List<StateObject> stateObjects(T... builders) Returns a list of theStateObjectsthat were previously created.Creates a new string literal.Creates an encapsulated expression:(expression).Creates the expressionx - y.protected voidCreates the expressionSUM(path).sumDistinct(String path) Creates the expressionSUM(path).Creates the expressionTYPE(identification_variable | single_valued_object_path_expression | input_parameter).Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.AbstractStateObjectBuilder
add, checkBuilder, checkBuilders, hasStateObjects, pop 
- 
Constructor Details
- 
AbstractScalarExpressionStateObjectBuilder
Creates a newAbstractScalarExpressionStateObjectBuilder.- Parameters:
 parent- The parent of the expression to build, which is only required when a JPQL fragment needs to be parsed
 
 - 
 - 
Method Details
- 
abs
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionABS(x).- Specified by:
 absin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- The parameter of theABSexpression- Returns:
 - This builder
 
 - 
add
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionx + y.- Specified by:
 addin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- The right side of the addition expression- Returns:
 - This builder
 
 - 
arithmetic
protected void arithmetic(boolean plusSign)  - 
avg
 - 
avg
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionAVG(path).- Specified by:
 avgin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path expression- Returns:
 - This builder
 
 - 
avgDistinct
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionAVG(DISTINCT path).- Specified by:
 avgDistinctin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path expression- Returns:
 - This builder
 
 - 
buildCollectionPath
 - 
buildIdentificationVariable
 - 
buildInputParameter
 - 
buildNumeric
 - 
buildNumeric
 - 
buildStateFieldPath
 - 
buildStringLiteral
 - 
case_
Description copied from interface:IScalarExpressionStateObjectBuilderCreates a newCASEexpression.- Specified by:
 case_in interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- Thebuilderof aCASEexpression- Returns:
 - This builder
 
 - 
coalesce
Description copied from interface:IScalarExpressionStateObjectBuilderCreate the expressionCOALESCE(scalar_expression {, scalar_expression}+).- Specified by:
 coalescein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder1- The first scalar expressionbuilder2- The second scalar expression- Returns:
 - This builder
 
 - 
coalesce
Description copied from interface:IScalarExpressionStateObjectBuilderCreate the expressionCOALESCE(scalar_expression {, scalar_expression}+).- Specified by:
 coalescein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder1- The first scalar expressionbuilder2- The second scalar expressionbuilders- The subsequent scalar expressions- Returns:
 - This builder
 
 - 
concat
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionCONCAT(string_primary, string_primary {, string_primary}*).- Specified by:
 concatin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder1- The first argument of the expressionbuilder2- The second argument of the expression- Returns:
 - This builder
 
 - 
concat
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionCONCAT(string_primary, string_primary {, string_primary}*).- Specified by:
 concatin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder1- The first argument of the expressionbuilder2- The second argument of the expressionbuilders- The subsequence arguments of the expression, which are optional- Returns:
 - This builder
 
 - 
count
 - 
count
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionCOUNT(identification_variable | state_field_path_expression | single_valued_object_path_expression).- Specified by:
 countin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path expression- Returns:
 - This builder
 
 - 
countDistinct
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionCOUNT(DISTINCT identification_variable | state_field_path_expression | single_valued_object_path_expression).- Specified by:
 countDistinctin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path expression- Returns:
 - This builder
 
 - 
currentDate
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expression representingCURRENT_DATE.- Specified by:
 currentDatein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Returns:
 - This builder
 
 - 
currentTime
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expression representingCURRENT_TIME.- Specified by:
 currentTimein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Returns:
 - This builder
 
 - 
currentTimestamp
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expression representingCURRENT_TIMESTAMP.- Specified by:
 currentTimestampin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Returns:
 - This builder
 
 - 
date
Description copied from interface:IScalarExpressionStateObjectBuilderCreates a new date using the JDBC syntax of a date.- Specified by:
 datein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Returns:
 - This builder
 
 - 
divide
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionx / y.- Specified by:
 dividein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- The right side of the division expression- Returns:
 - This builder
 
 - 
entityType
Description copied from interface:IScalarExpressionStateObjectBuilderCreates a new entity type literal.- Specified by:
 entityTypein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 entityTypeName- The short name of the entity- Returns:
 - This builder
 
 - 
enumLiteral
Description copied from interface:IScalarExpressionStateObjectBuilderCreates a new enum literal.- Specified by:
 enumLiteralin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 enumConstant- The enum constant- Returns:
 - This builder
 
 - 
function
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expression<identifier>('functionName' {, expression}*).- Specified by:
 functionin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 identifier- The JPQL identifier that is used to identify the SQL expressionfunctionName- The name of the native SQL functionarguments- The arguments of the expression- Returns:
 - This builder
 
 - 
function
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expression<identifier>('functionName' {, expression}*).- Specified by:
 functionin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 identifier- The JPQL identifier that is used to identify the SQL expressionfunctionName- The name of the native SQL function- Returns:
 - This builder
 
 - 
function
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expression<identifier>('functionName' {, expression}*).- Specified by:
 functionin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 identifier- The JPQL identifier that is used to identify the SQL expressionfunctionName- The name of the native SQL functionarguments- The arguments of the expression- Returns:
 - This builder
 
 - 
getCaseBuilder
Description copied from interface:IScalarExpressionStateObjectBuilderReturns the builder that can create aCASEexpression, which requires aIConditionalExpressionStateObjectBuilderto build theWHENclauses.- Specified by:
 getCaseBuilderin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Returns:
 - The builder of a 
CASEexpression 
 - 
getParent
Returns the parent of the expression to build, which is only required when a JPQL fragment needs to be parsed.- Returns:
 - The parent
 
 - 
index
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionINDEX(identification_variable).- Specified by:
 indexin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 variable- The identification variable- Returns:
 - This builder
 
 - 
length
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionLENGTH(expression).- Specified by:
 lengthin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- The encapsulated expression- Returns:
 - This builder
 
 - 
literal
 - 
literals
 - 
locate
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionLOCATE(string_primary, string_primary).- Specified by:
 locatein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 parameter1- The first string primaryparameter2- The second string primary- Returns:
 - This builder
 
 - 
locate
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionLOCATE(string_primary, string_primary [, simple_arithmetic_expression]).- Specified by:
 locatein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 parameter1- The first string primaryparameter2- The second string primaryparameter3- The position of the search within the string- Returns:
 - This builder
 
 - 
max
 - 
max
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionMAX(path).- Specified by:
 maxin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path expression- Returns:
 - This builder
 
 - 
maxDistinct
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionMAX(DISTINCT path).- Specified by:
 maxDistinctin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path expression- Returns:
 - This builder
 
 - 
min
 - 
min
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionAVG(path).- Specified by:
 minin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path expression- Returns:
 - This builder
 
 - 
minDistinct
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionAVG(DISTINCT path).- Specified by:
 minDistinctin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path expression- Returns:
 - This builder
 
 - 
minus
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expression- x.- Specified by:
 minusin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- The expression that will have the plus sign prepended- Returns:
 - This builder
 
 - 
mod
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionMOD(simple_arithmetic_expression, simple_arithmetic_expression).- Specified by:
 modin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 parameter1- The first parameterparameter2- The second parameter- Returns:
 - This builder
 
 - 
multiply
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionx * y.- Specified by:
 multiplyin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- The right side of the multiply expression- Returns:
 - This builder
 
 - 
nullIf
Description copied from interface:IScalarExpressionStateObjectBuilderCreate the expressionNULLIF(scalar_expression, scalar_expression).- Specified by:
 nullIfin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder1- The first scalar expressionbuilder2- The second scalar expression- Returns:
 - This builder
 
 - 
numeric
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the numeric literal.- Specified by:
 numericin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 number- The numeric literal- Returns:
 - This builder
 
 - 
numeric
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the numeric literal.- Specified by:
 numericin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 number- The numeric literal- Returns:
 - This builder
 
 - 
parameter
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the input parameter.- Specified by:
 parameterin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 parameter- The named or positional input parameter- Returns:
 - This builder
 
 - 
path
Description copied from interface:IScalarExpressionStateObjectBuilderCreates a new state field path expression.- Specified by:
 pathin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path path expression- Returns:
 - This builder
 
 - 
plus
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expression+ x.- Specified by:
 plusin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- The expression that will have the plus sign prepended- Returns:
 - This builder
 
 - 
size
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionSIZE(collection_valued_path_expression).- Specified by:
 sizein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The collection-valued path expression- Returns:
 - This builder
 
 - 
sqrt
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionSQRT(x).- Specified by:
 sqrtin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- The parameter of theABSexpression- Returns:
 - This builder
 
 - 
stateObjects
Returns a list of theStateObjectsthat were previously created.- Parameters:
 count- The number ofStateObjectsto move to the list- Returns:
 - The list of 
StateObjectsthat were added to the stack 
 - 
stateObjects
Returns a list of theStateObjectsthat were previously created.- Parameters:
 builders- The list ofbuildersis used to determine how manyStateObjectsneeds to be pulled out of the stack- Returns:
 - The list of 
StateObjectsthat were added to the stack 
 - 
string
Description copied from interface:IScalarExpressionStateObjectBuilderCreates a new string literal.- Specified by:
 stringin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 literal- The string literal- Returns:
 - This builder
 
 - 
sub
Description copied from interface:IScalarExpressionStateObjectBuilderCreates an encapsulated expression:(expression).- Specified by:
 subin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- The expression that will be encapsulated- Returns:
 - This builder
 
 - 
subtract
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionx - y.- Specified by:
 subtractin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 builder- The right side of the addition expression- Returns:
 - This builder
 
 - 
sum
 - 
sum
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionSUM(path).- Specified by:
 sumin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path expression- Returns:
 - This builder
 
 - 
sumDistinct
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionSUM(path).- Specified by:
 sumDistinctin interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The state field path expression- Returns:
 - This builder
 
 - 
type
Description copied from interface:IScalarExpressionStateObjectBuilderCreates the expressionTYPE(identification_variable | single_valued_object_path_expression | input_parameter).- Specified by:
 typein interfaceIScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>- Parameters:
 path- The identification variable or the input parameter- Returns:
 - This builder
 
 
 -