Interface Val
-
- All Superinterfaces:
java.io.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
public interface Val extends Value
A Value represents any non-operator in a query filter, including constants, variables, and object fields.- Author:
- Abe White
-
-
Field Summary
Fields Modifier and Type Field Description static intABS_VALstatic intARGS_VALstatic intCMP_EQUALInitialization flag indicating to this value is for compare/equal path.static intCOALESCE_VALstatic intCONCAT_VALstatic intFORCE_OUTERInitialization flag indicating to force an outer join into any relation path.static intGENERALCASE_VALstatic intINDEXOF_VALstatic intJOIN_RELInitialization flag indicating to join into any relation path.static intLENGTH_VALstatic intLOCATE_VALstatic intLOWER_VALstatic intMATH_VALstatic intNULL_CMPInitialization flag indicating that this value will be compared to null.static intNULLIF_VALstatic intSIMPLECASE_VALstatic intSQRT_VALstatic intSUBSTRING_VALstatic intTRIM_VALstatic intUPPER_VALstatic intVALstatic intWHENCONDITION_VALstatic intWHENSCALAR_VAL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidappendIndex(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)Append the SQL checking the index of this value.voidappendIsEmpty(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)Append the SQL testing whether this value is empty to the given buffer.voidappendIsNotEmpty(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)Append the SQL testing whether this value is not empty to the given buffer.voidappendIsNotNull(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)Append the SQL testing whether this value is not null to the given buffer.voidappendIsNull(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)Append the SQL testing whether this value is null to the given buffer.voidappendSize(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)Append the SQL checking the size of this value.voidappendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index)Append theindexth SQL element to the given buffer.voidappendType(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)Append the SQL checking the type of this value.voidcalculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState)Calculate and cache the SQL for this value.intgetId()ValuegetSelectAs()Return 'this' concrete class if alias is set, otherwise nullvoidgroupBy(Select sel, ExpContext ctx, ExpState state)Group by this value.ExpStateinitialize(Select sel, ExpContext ctx, int flags)Initialize the value.intlength(Select sel, ExpContext ctx, ExpState state)Return the number of SQL elements in this value.java.lang.Objectload(ExpContext ctx, ExpState state, Result res)Load the data for this value.voidorderBy(Select sel, ExpContext ctx, ExpState state, boolean asc)Order by this value.voidselect(Select sel, ExpContext ctx, ExpState state, boolean pks)Select the data for this value.voidselectColumns(Select sel, ExpContext ctx, ExpState state, boolean pks)Select just the columns for this value.java.lang.ObjecttoDataStoreValue(Select sel, ExpContext ctx, ExpState state, java.lang.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 Detail
-
NULL_CMP
static final int NULL_CMP
Initialization flag indicating that this value will be compared to null.- See Also:
- Constant Field Values
-
JOIN_REL
static final int JOIN_REL
Initialization flag indicating to join into any relation path.- See Also:
- Constant Field Values
-
FORCE_OUTER
static final int FORCE_OUTER
Initialization flag indicating to force an outer join into any relation path.- See Also:
- Constant Field Values
-
CMP_EQUAL
static final int CMP_EQUAL
Initialization flag indicating to this value is for compare/equal path.- See Also:
- Constant Field Values
-
VAL
static final int VAL
- See Also:
- Constant Field Values
-
MATH_VAL
static final int MATH_VAL
- See Also:
- Constant Field Values
-
CONCAT_VAL
static final int CONCAT_VAL
- See Also:
- Constant Field Values
-
SUBSTRING_VAL
static final int SUBSTRING_VAL
- See Also:
- Constant Field Values
-
UPPER_VAL
static final int UPPER_VAL
- See Also:
- Constant Field Values
-
LOWER_VAL
static final int LOWER_VAL
- See Also:
- Constant Field Values
-
TRIM_VAL
static final int TRIM_VAL
- See Also:
- Constant Field Values
-
LENGTH_VAL
static final int LENGTH_VAL
- See Also:
- Constant Field Values
-
LOCATE_VAL
static final int LOCATE_VAL
- See Also:
- Constant Field Values
-
ARGS_VAL
static final int ARGS_VAL
- See Also:
- Constant Field Values
-
INDEXOF_VAL
static final int INDEXOF_VAL
- See Also:
- Constant Field Values
-
ABS_VAL
static final int ABS_VAL
- See Also:
- Constant Field Values
-
SQRT_VAL
static final int SQRT_VAL
- See Also:
- Constant Field Values
-
SIMPLECASE_VAL
static final int SIMPLECASE_VAL
- See Also:
- Constant Field Values
-
GENERALCASE_VAL
static final int GENERALCASE_VAL
- See Also:
- Constant Field Values
-
WHENCONDITION_VAL
static final int WHENCONDITION_VAL
- See Also:
- Constant Field Values
-
WHENSCALAR_VAL
static final int WHENSCALAR_VAL
- See Also:
- Constant Field Values
-
COALESCE_VAL
static final int COALESCE_VAL
- See Also:
- Constant Field Values
-
NULLIF_VAL
static final int NULLIF_VAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
ExpState initialize(Select sel, ExpContext ctx, int flags)
Initialize the value. This method should recursively initialize any sub-values.
-
toDataStoreValue
java.lang.Object toDataStoreValue(Select sel, ExpContext ctx, ExpState state, java.lang.Object val)
Return the datastore value of the given object in the context of this value.
-
select
void select(Select sel, ExpContext ctx, ExpState state, boolean pks)
Select the data for this value.
-
selectColumns
void selectColumns(Select sel, ExpContext ctx, ExpState state, boolean pks)
Select just the columns for this value.
-
groupBy
void groupBy(Select sel, ExpContext ctx, ExpState state)
Group by this value.
-
orderBy
void orderBy(Select sel, ExpContext ctx, ExpState state, boolean asc)
Order by this value.
-
load
java.lang.Object load(ExpContext ctx, ExpState state, Result res) throws java.sql.SQLException
Load the data for this value.- Throws:
java.sql.SQLException
-
calculateValue
void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState)
Calculate and cache the SQL for this value. This method is called beforelengthor anyappendmethods.- Parameters:
other- the value being compared to, or null if not a comparison
-
length
int length(Select sel, ExpContext ctx, ExpState state)
Return the number of SQL elements in this value.
-
appendTo
void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index)
Append theindexth SQL element to the given buffer.
-
appendIsEmpty
void appendIsEmpty(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Append the SQL testing whether this value is empty to the given buffer.
-
appendIsNotEmpty
void appendIsNotEmpty(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Append the SQL testing whether this value is not empty to the given buffer.
-
appendIndex
void appendIndex(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Append the SQL checking the index of this value.
-
appendType
void appendType(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Append the SQL checking the type of this value.
-
appendSize
void appendSize(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Append the SQL checking the size of this value.
-
appendIsNull
void appendIsNull(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Append the SQL testing whether this value is null to the given buffer.
-
appendIsNotNull
void appendIsNotNull(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Append the SQL testing whether this value is not null to the given buffer.
-
getId
int getId()
-
getSelectAs
Value getSelectAs()
Description copied from interface:ValueReturn 'this' concrete class if alias is set, otherwise null- Specified by:
getSelectAsin interfaceValue
-
-