public abstract class AbstractScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>> extends AbstractStateObjectBuilder implements IScalarExpressionStateObjectBuilder<T>
scalar expression.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractScalarExpressionStateObjectBuilder(StateObject parent)
Creates a new
AbstractScalarExpressionStateObjectBuilder. |
| Modifier and Type | Method and Description |
|---|---|
T |
abs(T builder)
Creates the expression
ABS(x). |
T |
add(T builder)
Creates the expression
x + y. |
protected void |
arithmetic(boolean plusSign) |
protected void |
avg(boolean distinct,
java.lang.String path) |
T |
avg(java.lang.String path)
Creates the expression
AVG(path). |
T |
avgDistinct(java.lang.String path)
Creates the expression
AVG(DISTINCT path). |
protected StateObject |
buildCollectionPath(java.lang.String path) |
protected StateObject |
buildIdentificationVariable(java.lang.String literal) |
protected StateObject |
buildInputParameter(java.lang.String parameter) |
protected StateObject |
buildNumeric(java.lang.Number number) |
protected StateObject |
buildNumeric(java.lang.String number) |
protected StateObject |
buildStateFieldPath(java.lang.String path) |
protected StateObject |
buildStringLiteral(java.lang.String literal) |
T |
case_(ICaseExpressionStateObjectBuilder builder)
Creates a new
CASE expression. |
T |
coalesce(T builder1,
T builder2,
T... builders)
Create the expression
COALESCE(scalar_expression {, scalar_expression}+). |
T |
concat(T builder1,
T builder2,
T... builders)
Creates the expression
CONCAT(string_primary, string_primary {, string_primary}*). |
protected void |
count(boolean distinct,
java.lang.String path) |
T |
count(java.lang.String path)
Creates the expression
COUNT(identification_variable |
state_field_path_expression |
single_valued_object_path_expression). |
T |
countDistinct(java.lang.String path)
Creates the expression
COUNT(DISTINCT identification_variable |
state_field_path_expression |
single_valued_object_path_expression). |
T |
currentDate()
Creates the expression representing
CURRENT_DATE. |
T |
currentTime()
Creates the expression representing
CURRENT_TIME. |
T |
currentTimestamp()
Creates the expression representing
CURRENT_TIMESTAMP. |
T |
date(java.lang.String jdbcDate)
Creates a new date using the JDBC syntax of a date.
|
T |
divide(T builder)
Creates the expression
x ÷ y. |
T |
entityType(java.lang.String entityTypeName)
Creates a new entity type literal.
|
T |
enumLiteral(java.lang.Enum<? extends java.lang.Enum<?>> enumConstant)
Creates a new enum literal.
|
T |
function(java.lang.String identifier,
java.lang.String functionName,
java.lang.String... arguments)
Creates the expression
<identifier>('functionName' {, expression}*). |
T |
function(java.lang.String identifier,
java.lang.String functionName,
T... arguments)
Creates the expression
<identifier>('functionName' {, expression}*). |
ICaseExpressionStateObjectBuilder |
getCaseBuilder()
Returns the builder that can create a
CASE expression, which requires a
IConditionalExpressionStateObjectBuilder to build the WHEN clauses. |
protected StateObject |
getParent()
Returns the parent of the expression to build, which is only required when a JPQL fragment
needs to be parsed.
|
T |
index(java.lang.String variable)
Creates the expression
INDEX(identification_variable). |
T |
length(T builder)
Creates the expression
LENGTH(expression). |
protected StateObject |
literal(java.lang.String literal) |
protected java.util.List<StateObject> |
literals(java.lang.String... literals) |
T |
locate(T parameter1,
T parameter2)
Creates the expression
LOCATE(string_primary, string_primary). |
T |
locate(T parameter1,
T parameter2,
T parameter3)
Creates the expression
LOCATE(string_primary, string_primary [, simple_arithmetic_expression]). |
protected void |
max(boolean distinct,
java.lang.String path) |
T |
max(java.lang.String path)
Creates the expression
MAX(path). |
T |
maxDistinct(java.lang.String path)
Creates the expression
MAX(DISTINCT path). |
protected void |
min(boolean distinct,
java.lang.String path) |
T |
min(java.lang.String path)
Creates the expression
AVG(path). |
T |
minDistinct(java.lang.String path)
Creates the expression
AVG(DISTINCT path). |
T |
minus(T builder)
Creates the expression
- x. |
T |
mod(T parameter1,
T parameter2)
Creates the expression
MOD(simple_arithmetic_expression, simple_arithmetic_expression). |
T |
multiply(T builder)
Creates the expression
x × y. |
T |
nullIf(T builder1,
T builder2)
Create the expression
NULLIF(scalar_expression, scalar_expression). |
T |
numeric(java.lang.Number number)
Creates the numeric literal.
|
T |
numeric(java.lang.String number)
Creates the numeric literal.
|
T |
parameter(java.lang.String parameter)
Creates the input parameter.
|
T |
path(java.lang.String path)
Creates a new state field path expression.
|
T |
plus(T builder)
Creates the expression
+ x. |
T |
size(java.lang.String path)
Creates the expression
SIZE(collection_valued_path_expression). |
T |
sqrt(T builder)
Creates the expression
SQRT(x). |
protected java.util.List<StateObject> |
stateObjects(int count)
Returns a list of the
StateObjects that were previously created. |
protected java.util.List<StateObject> |
stateObjects(T... builders)
Returns a list of the
StateObjects that were previously created. |
T |
string(java.lang.String literal)
Creates a new string literal.
|
T |
sub(T builder)
Creates an encapsulated expression:
(expression). |
T |
subtract(T builder)
Creates the expression
x - y. |
protected void |
sum(boolean distinct,
java.lang.String path) |
T |
sum(java.lang.String path)
Creates the expression
SUM(path). |
T |
sumDistinct(java.lang.String path)
Creates the expression
SUM(path). |
T |
type(java.lang.String path)
Creates the expression
TYPE(identification_variable | single_valued_object_path_expression | input_parameter). |
add, checkBuilder, checkBuilders, hasStateObjects, popprotected AbstractScalarExpressionStateObjectBuilder(StateObject parent)
AbstractScalarExpressionStateObjectBuilder.parent - The parent of the expression to build, which is only required when a JPQL
fragment needs to be parsedpublic T abs(T builder)
ABS(x).abs in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The parameter of the ABS expressionpublic T add(T builder)
x + y.add in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The right side of the addition expressionprotected void arithmetic(boolean plusSign)
protected void avg(boolean distinct,
java.lang.String path)
public T avg(java.lang.String path)
AVG(path).avg in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path expressionpublic T avgDistinct(java.lang.String path)
AVG(DISTINCT path).avgDistinct in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path expressionprotected StateObject buildCollectionPath(java.lang.String path)
protected StateObject buildIdentificationVariable(java.lang.String literal)
protected StateObject buildInputParameter(java.lang.String parameter)
protected StateObject buildNumeric(java.lang.Number number)
protected StateObject buildNumeric(java.lang.String number)
protected StateObject buildStateFieldPath(java.lang.String path)
protected StateObject buildStringLiteral(java.lang.String literal)
public T case_(ICaseExpressionStateObjectBuilder builder)
CASE expression.case_ in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The builder of a CASE
expressionpublic T coalesce(T builder1, T builder2, T... builders)
COALESCE(scalar_expression {, scalar_expression}+).coalesce in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder1 - The first scalar expressionbuilder2 - The second scalar expressionbuilders - The subsequent scalar expressionspublic T concat(T builder1, T builder2, T... builders)
CONCAT(string_primary, string_primary {, string_primary}*).concat in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder1 - The first argument of the expressionbuilder2 - The second argument of the expressionbuilders - The subsequence arguments of the expression, which are optionalprotected void count(boolean distinct,
java.lang.String path)
public T count(java.lang.String path)
COUNT(identification_variable |
state_field_path_expression |
single_valued_object_path_expression).count in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path expressionpublic T countDistinct(java.lang.String path)
COUNT(DISTINCT identification_variable |
state_field_path_expression |
single_valued_object_path_expression).countDistinct in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path expressionpublic T currentDate()
CURRENT_DATE.currentDate in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>public T currentTime()
CURRENT_TIME.currentTime in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>public T currentTimestamp()
CURRENT_TIMESTAMP.currentTimestamp in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>public T date(java.lang.String jdbcDate)
date in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>public T divide(T builder)
x ÷ y.divide in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The right side of the addition expressionpublic T entityType(java.lang.String entityTypeName)
entityType in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>entityTypeName - The short name of the entitypublic T enumLiteral(java.lang.Enum<? extends java.lang.Enum<?>> enumConstant)
enumLiteral in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>enumConstant - The enum constantpublic T function(java.lang.String identifier, java.lang.String functionName, java.lang.String... arguments)
<identifier>('functionName' {, expression}*).function in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>identifier - The JPQL identifier that is used to identify the SQL expressionfunctionName - The name of the native SQL functionarguments - The arguments of the expressionpublic T function(java.lang.String identifier, java.lang.String functionName, T... arguments)
<identifier>('functionName' {, expression}*).function in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>identifier - The JPQL identifier that is used to identify the SQL expressionfunctionName - The name of the native SQL functionarguments - The arguments of the expressionpublic ICaseExpressionStateObjectBuilder getCaseBuilder()
CASE expression, which requires a
IConditionalExpressionStateObjectBuilder to build the WHEN clauses.getCaseBuilder in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>CASE expressionprotected StateObject getParent()
public T index(java.lang.String variable)
INDEX(identification_variable).index in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>variable - The identification variablepublic T length(T builder)
LENGTH(expression).length in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The encapsulated expressionprotected StateObject literal(java.lang.String literal)
protected java.util.List<StateObject> literals(java.lang.String... literals)
public T locate(T parameter1, T parameter2)
LOCATE(string_primary, string_primary).locate in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>parameter1 - The first string primaryparameter2 - The second string primarypublic T locate(T parameter1, T parameter2, T parameter3)
LOCATE(string_primary, string_primary [, simple_arithmetic_expression]).locate in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>parameter1 - The first string primaryparameter2 - The second string primaryparameter3 - The position of the search within the stringprotected void max(boolean distinct,
java.lang.String path)
public T max(java.lang.String path)
MAX(path).max in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path expressionpublic T maxDistinct(java.lang.String path)
MAX(DISTINCT path).maxDistinct in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path expressionprotected void min(boolean distinct,
java.lang.String path)
public T min(java.lang.String path)
AVG(path).min in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path expressionpublic T minDistinct(java.lang.String path)
AVG(DISTINCT path).minDistinct in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path expressionpublic T minus(T builder)
- x.minus in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The expression that will have the plus sign prependedpublic T mod(T parameter1, T parameter2)
MOD(simple_arithmetic_expression, simple_arithmetic_expression).mod in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>parameter1 - The first parameterparameter2 - The second parameterpublic T multiply(T builder)
x × y.multiply in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The right side of the addition expressionpublic T nullIf(T builder1, T builder2)
NULLIF(scalar_expression, scalar_expression).nullIf in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder1 - The first scalar expressionbuilder2 - The second scalar expressionpublic T numeric(java.lang.Number number)
numeric in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>number - The numeric literalpublic T numeric(java.lang.String number)
numeric in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>number - The numeric literalpublic T parameter(java.lang.String parameter)
parameter in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>parameter - The named or positional input parameterpublic T path(java.lang.String path)
path in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path path expressionpublic T plus(T builder)
+ x.plus in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The expression that will have the plus sign prependedpublic T size(java.lang.String path)
SIZE(collection_valued_path_expression).size in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The collection-valued path expressionpublic T sqrt(T builder)
SQRT(x).sqrt in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The parameter of the ABS expressionprotected java.util.List<StateObject> stateObjects(int count)
StateObjects that were previously created.count - The number of StateObjects to move to the listStateObjects that were added to the stackprotected java.util.List<StateObject> stateObjects(T... builders)
StateObjects that were previously created.builders - The list of builders is used to
determine how many StateObjects needs to be pulled out of the stackStateObjects that were added to the stackpublic T string(java.lang.String literal)
string in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>literal - The string literalpublic T sub(T builder)
(expression).sub in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The expression that will be encapsulatedpublic T subtract(T builder)
x - y.subtract in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>builder - The right side of the addition expressionprotected void sum(boolean distinct,
java.lang.String path)
public T sum(java.lang.String path)
SUM(path).sum in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path expressionpublic T sumDistinct(java.lang.String path)
SUM(path).sumDistinct in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The state field path expressionpublic T type(java.lang.String path)
TYPE(identification_variable | single_valued_object_path_expression | input_parameter).type in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>path - The identification variable or the input parameter