|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.jpa.jpql.model.AbstractStateObjectBuilder
org.eclipse.persistence.jpa.jpql.model.AbstractScalarExpressionStateObjectBuilder<T>
public abstract class AbstractScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
This abstract definition of a builder provides the support for creating expressions defined by a
scalar expression
.
Constructor Summary | |
---|---|
protected |
AbstractScalarExpressionStateObjectBuilder(StateObject parent)
Creates a new AbstractScalarExpressionStateObjectBuilder . |
Method Summary | |
---|---|
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) . |
Methods inherited from class org.eclipse.persistence.jpa.jpql.model.AbstractStateObjectBuilder |
---|
add, checkBuilder, checkBuilders, hasStateObjects, pop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractScalarExpressionStateObjectBuilder(StateObject parent)
AbstractScalarExpressionStateObjectBuilder
.
parent
- The parent of the expression to build, which is only required when a JPQL
fragment needs to be parsedMethod Detail |
---|
public T abs(T builder)
ABS(x)
.
abs
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
builder
- The parameter of the ABS
expression
public T add(T builder)
x + y
.
add
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
builder
- The right side of the addition expression
protected 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 expression
public T avgDistinct(java.lang.String path)
AVG(DISTINCT path)
.
avgDistinct
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
path
- The state field path expression
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)
public T case_(ICaseExpressionStateObjectBuilder builder)
CASE
expression.
case_
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
builder
- The builder
of a CASE
expression
public T coalesce(T builder1, T builder2, T... builders)
COALESCE(scalar_expression {, scalar_expression}+).
- Specified by:
coalesce
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
- Parameters:
builder1
- The first scalar expressionbuilder2
- The second scalar expressionbuilders
- The subsequent scalar expressions
- Returns:
- This This builder
public 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 optional
protected 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 expression
public 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 expression
public 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 expression
public T entityType(java.lang.String entityTypeName)
entityType
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
entityTypeName
- The short name of the entity
public T enumLiteral(java.lang.Enum<? extends java.lang.Enum<?>> enumConstant)
enumLiteral
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
enumConstant
- The enum constant
public 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 expression
public 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 expression
public 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 variable
public T length(T builder)
LENGTH(expression)
.
length
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
builder
- The encapsulated expression
protected 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 primary
public 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 string
protected 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 expression
public T maxDistinct(java.lang.String path)
MAX(DISTINCT path)
.
maxDistinct
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
path
- The state field path expression
protected 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 expression
public T minDistinct(java.lang.String path)
AVG(DISTINCT path)
.
minDistinct
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
path
- The state field path expression
public T minus(T builder)
- x
.
minus
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
builder
- The expression that will have the plus sign prepended
public 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 parameter
public T multiply(T builder)
x × y
.
multiply
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
builder
- The right side of the addition expression
public T nullIf(T builder1, T builder2)
NULLIF(scalar_expression, scalar_expression).
- Specified by:
nullIf
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
- Parameters:
builder1
- The first scalar expressionbuilder2
- The second scalar expression
- Returns:
- This This builder
public T numeric(java.lang.Number number)
numeric
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
number
- The numeric literal
public T numeric(java.lang.String number)
numeric
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
number
- The numeric literal
public T parameter(java.lang.String parameter)
parameter
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
parameter
- The named or positional input parameter
public T path(java.lang.String path)
path
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
path
- The state field path path expression
public T plus(T builder)
+ x
.
plus
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
builder
- The expression that will have the plus sign prepended
public T size(java.lang.String path)
SIZE(collection_valued_path_expression)
.
size
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
path
- The collection-valued path expression
public T sqrt(T builder)
SQRT(x)
.
sqrt
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
builder
- The parameter of the ABS
expression
protected java.util.List<StateObject> stateObjects(int count)
StateObjects
that were previously created.
count
- The number of StateObjects
to move to the list
StateObjects
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 stack
StateObjects
that were added to the stackpublic T string(java.lang.String literal)
string
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
literal
- The string literal
public T sub(T builder)
(expression)
.
sub
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
builder
- The expression that will be encapsulated
public T subtract(T builder)
x - y
.
subtract
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
builder
- The right side of the addition expression
protected 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 expression
public T sumDistinct(java.lang.String path)
SUM(path)
.
sumDistinct
in interface IScalarExpressionStateObjectBuilder<T extends IScalarExpressionStateObjectBuilder<T>>
path
- The state field path expression
public 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
|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |