Interface Val
- All Superinterfaces:
Serializable
,Value
- All Known Implementing Classes:
Abs
,Args
,CoalesceExpression
,CollectionParam
,Concat
,DatastoreFunction
,GeneralCaseExpression
,IndexOf
,Lit
,MapEntry
,MapKey
,Math
,Null
,NullableAggregateUnaryOp
,NullIfExpression
,Param
,PCPath
,SimpleCaseExpression
,Sqrt
,StringLength
,SubQ
,Substring
,ToLowerCase
,ToUpperCase
,Trim
,TypeLit
A Value represents any non-operator in a query filter, including
constants, variables, and object fields.
- Author:
- Abe White
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
Initialization flag indicating to this value is for compare/equal path.static final int
static final int
static final int
Initialization flag indicating to force an outer join into any relation path.static final int
static final int
static final int
Initialization flag indicating to join into any relation path.static final int
static final int
static final int
static final int
static final int
Initialization flag indicating that this value will be compared to null.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendIndex
(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) Append the SQL checking the index of this value.void
appendIsEmpty
(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) Append the SQL testing whether this value is empty to the given buffer.void
appendIsNotEmpty
(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) Append the SQL testing whether this value is not empty to the given buffer.void
appendIsNotNull
(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) Append the SQL testing whether this value is not null to the given buffer.void
appendIsNull
(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) Append the SQL testing whether this value is null to the given buffer.void
appendSize
(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) Append the SQL checking the size of this value.void
appendTo
(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) Append theindex
th SQL element to the given buffer.void
appendType
(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) Append the SQL checking the type of this value.void
calculateValue
(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) Calculate and cache the SQL for this value.int
getId()
Return 'this' concrete class if alias is set, otherwise nullvoid
groupBy
(Select sel, ExpContext ctx, ExpState state) Group by this value.initialize
(Select sel, ExpContext ctx, int flags) Initialize the value.int
length
(Select sel, ExpContext ctx, ExpState state) Return the number of SQL elements in this value.load
(ExpContext ctx, ExpState state, Result res) Load the data for this value.void
orderBy
(Select sel, ExpContext ctx, ExpState state, boolean asc) Order by this value.void
select
(Select sel, ExpContext ctx, ExpState state, boolean pks) Select the data for this value.void
selectColumns
(Select sel, ExpContext ctx, ExpState state, boolean pks) Select just the columns for this value.toDataStoreValue
(Select sel, ExpContext ctx, ExpState state, Object val) Return the datastore value of the given object in the context of this value.Methods inherited from interface org.apache.openjpa.kernel.exps.Value
acceptVisit, getAlias, getMetaData, getName, getPath, getType, isAggregate, isVariable, isXPath, setAlias, setImplicitType, setMetaData
-
Field Details
-
NULL_CMP
static final int NULL_CMPInitialization flag indicating that this value will be compared to null.- See Also:
-
JOIN_REL
static final int JOIN_RELInitialization flag indicating to join into any relation path.- See Also:
-
FORCE_OUTER
static final int FORCE_OUTERInitialization flag indicating to force an outer join into any relation path.- See Also:
-
CMP_EQUAL
static final int CMP_EQUALInitialization flag indicating to this value is for compare/equal path.- See Also:
-
VAL
static final int VAL- See Also:
-
MATH_VAL
static final int MATH_VAL- See Also:
-
CONCAT_VAL
static final int CONCAT_VAL- See Also:
-
SUBSTRING_VAL
static final int SUBSTRING_VAL- See Also:
-
UPPER_VAL
static final int UPPER_VAL- See Also:
-
LOWER_VAL
static final int LOWER_VAL- See Also:
-
TRIM_VAL
static final int TRIM_VAL- See Also:
-
LENGTH_VAL
static final int LENGTH_VAL- See Also:
-
LOCATE_VAL
static final int LOCATE_VAL- See Also:
-
ARGS_VAL
static final int ARGS_VAL- See Also:
-
INDEXOF_VAL
static final int INDEXOF_VAL- See Also:
-
ABS_VAL
static final int ABS_VAL- See Also:
-
SQRT_VAL
static final int SQRT_VAL- See Also:
-
SIMPLECASE_VAL
static final int SIMPLECASE_VAL- See Also:
-
GENERALCASE_VAL
static final int GENERALCASE_VAL- See Also:
-
WHENCONDITION_VAL
static final int WHENCONDITION_VAL- See Also:
-
WHENSCALAR_VAL
static final int WHENSCALAR_VAL- See Also:
-
COALESCE_VAL
static final int COALESCE_VAL- See Also:
-
NULLIF_VAL
static final int NULLIF_VAL- See Also:
-
-
Method Details
-
initialize
Initialize the value. This method should recursively initialize any sub-values. -
toDataStoreValue
Return the datastore value of the given object in the context of this value. -
select
Select the data for this value. -
selectColumns
Select just the columns for this value. -
groupBy
Group by this value. -
orderBy
Order by this value. -
load
Load the data for this value.- Throws:
SQLException
-
calculateValue
Calculate and cache the SQL for this value. This method is called beforelength
or anyappend
methods.- Parameters:
other
- the value being compared to, or null if not a comparison
-
length
Return the number of SQL elements in this value. -
appendTo
Append theindex
th SQL element to the given buffer. -
appendIsEmpty
Append the SQL testing whether this value is empty to the given buffer. -
appendIsNotEmpty
Append the SQL testing whether this value is not empty to the given buffer. -
appendIndex
Append the SQL checking the index of this value. -
appendType
Append the SQL checking the type of this value. -
appendSize
Append the SQL checking the size of this value. -
appendIsNull
Append the SQL testing whether this value is null to the given buffer. -
appendIsNotNull
Append the SQL testing whether this value is not null to the given buffer. -
getId
int getId() -
getSelectAs
Value getSelectAs()Description copied from interface:Value
Return 'this' concrete class if alias is set, otherwise null- Specified by:
getSelectAs
in interfaceValue
-