Class SimpleCaseExpression
- java.lang.Object
-
- org.apache.openjpa.jdbc.kernel.exps.SimpleCaseExpression
-
public class SimpleCaseExpression extends java.lang.ObjectSimple case expression.- Author:
- Catalina Wei
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringFALSEprotected static java.lang.StringTRUE-
Fields inherited from interface org.apache.openjpa.jdbc.kernel.exps.Val
ABS_VAL, ARGS_VAL, CMP_EQUAL, COALESCE_VAL, CONCAT_VAL, FORCE_OUTER, GENERALCASE_VAL, INDEXOF_VAL, JOIN_REL, LENGTH_VAL, LOCATE_VAL, LOWER_VAL, MATH_VAL, NULL_CMP, NULLIF_VAL, SIMPLECASE_VAL, SQRT_VAL, SUBSTRING_VAL, TRIM_VAL, UPPER_VAL, VAL, WHENCONDITION_VAL, WHENSCALAR_VAL
-
-
Constructor Summary
Constructors Constructor Description SimpleCaseExpression(Val caseOperand, org.apache.openjpa.jdbc.kernel.exps.Exp[] exp, Val val)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptVisit(ExpressionVisitor visitor)Accept a visit from a tree visitor.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 buf, 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.java.lang.StringgetAlias()Return select item aliasValgetCaseOperand()org.apache.openjpa.jdbc.kernel.exps.Exp[]getExp()intgetId()ClassMetaDatagetMetaData()Return any associated persistent type.java.lang.StringgetName()ValuegetOtherPath()ExpStategetOtherState()PathgetPath()ValuegetSelectAs()Return 'this' concrete class if alias is set, otherwise nulljava.lang.ClassgetType()Return the expected type for this value, orObjectif the type is unknown.ValgetVal()voidgroupBy(Select sel, ExpContext ctx, ExpState state)Group by this value.ExpStateinitialize(Select sel, ExpContext ctx, int flags)Initialize the value.booleanisAggregate()Return true if this value is an aggregate.booleanisVariable()Return true if this value is a variable.booleanisXPath()Return true if this value is an XML Path.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.voidsetAlias(java.lang.String alias)Set select item aliasvoidsetImplicitType(java.lang.Class type)Set the implicit type of the value, based on how it is used in the filter.voidsetMetaData(ClassMetaData meta)Associate a persistent type with this value.voidsetOtherPath(Value other)voidsetOtherState(ExpState otherState)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.
-
-
-
Field Detail
-
TRUE
protected static final java.lang.String TRUE
- See Also:
- Constant Field Values
-
FALSE
protected static final java.lang.String FALSE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCaseOperand
public Val getCaseOperand()
-
getExp
public org.apache.openjpa.jdbc.kernel.exps.Exp[] getExp()
-
getVal
public Val getVal()
-
getType
public java.lang.Class getType()
Description copied from interface:ValueReturn the expected type for this value, orObjectif the type is unknown.
-
initialize
public ExpState initialize(Select sel, ExpContext ctx, int flags)
Description copied from interface:ValInitialize the value. This method should recursively initialize any sub-values.
-
appendTo
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf, int index)
Description copied from interface:ValAppend theindexth SQL element to the given buffer.
-
selectColumns
public void selectColumns(Select sel, ExpContext ctx, ExpState state, boolean pks)
Description copied from interface:ValSelect just the columns for this value.
-
acceptVisit
public void acceptVisit(ExpressionVisitor visitor)
Description copied from interface:ValueAccept a visit from a tree visitor.- Specified by:
acceptVisitin interfaceValue
-
calculateValue
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState)
Description copied from interface:ValCalculate and cache the SQL for this value. This method is called beforelengthor anyappendmethods.other- the value being compared to, or null if not a comparison
-
groupBy
public void groupBy(Select sel, ExpContext ctx, ExpState state)
Description copied from interface:ValGroup by this value.
-
length
public int length(Select sel, ExpContext ctx, ExpState state)
Description copied from interface:ValReturn the number of SQL elements in this value.
-
load
public java.lang.Object load(ExpContext ctx, ExpState state, Result res) throws java.sql.SQLException
Description copied from interface:ValLoad the data for this value.- Throws:
java.sql.SQLException
-
orderBy
public void orderBy(Select sel, ExpContext ctx, ExpState state, boolean asc)
Description copied from interface:ValOrder by this value.
-
select
public void select(Select sel, ExpContext ctx, ExpState state, boolean pks)
Description copied from interface:ValSelect the data for this value.
-
getMetaData
public ClassMetaData getMetaData()
Description copied from interface:ValueReturn any associated persistent type.
-
setImplicitType
public void setImplicitType(java.lang.Class type)
Description copied from interface:ValueSet the implicit type of the value, based on how it is used in the filter. This method is only called on values who returnObjectfromValue.getType().
-
setMetaData
public void setMetaData(ClassMetaData meta)
Description copied from interface:ValueAssociate a persistent type with this value.
-
setOtherPath
public void setOtherPath(Value other)
-
getOtherPath
public Value getOtherPath()
-
setOtherState
public void setOtherState(ExpState otherState)
-
getOtherState
public ExpState getOtherState()
-
isVariable
public boolean isVariable()
Description copied from interface:ValueReturn true if this value is a variable.- Specified by:
isVariablein interfaceValue
-
isAggregate
public boolean isAggregate()
Description copied from interface:ValueReturn true if this value is an aggregate.- Specified by:
isAggregatein interfaceValue
-
isXPath
public boolean isXPath()
Description copied from interface:ValueReturn true if this value is an XML Path.
-
toDataStoreValue
public java.lang.Object toDataStoreValue(Select sel, ExpContext ctx, ExpState state, java.lang.Object val)
Description copied from interface:ValReturn the datastore value of the given object in the context of this value.- Specified by:
toDataStoreValuein interfaceVal
-
appendIsEmpty
public void appendIsEmpty(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Description copied from interface:ValAppend the SQL testing whether this value is empty to the given buffer.- Specified by:
appendIsEmptyin interfaceVal
-
appendIsNotEmpty
public void appendIsNotEmpty(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Description copied from interface:ValAppend the SQL testing whether this value is not empty to the given buffer.- Specified by:
appendIsNotEmptyin interfaceVal
-
appendIsNull
public void appendIsNull(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Description copied from interface:ValAppend the SQL testing whether this value is null to the given buffer.- Specified by:
appendIsNullin interfaceVal
-
appendIsNotNull
public void appendIsNotNull(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Description copied from interface:ValAppend the SQL testing whether this value is not null to the given buffer.- Specified by:
appendIsNotNullin interfaceVal
-
appendIndex
public void appendIndex(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Description copied from interface:ValAppend the SQL checking the index of this value.- Specified by:
appendIndexin interfaceVal
-
appendType
public void appendType(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Description copied from interface:ValAppend the SQL checking the type of this value.- Specified by:
appendTypein interfaceVal
-
appendSize
public void appendSize(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql)
Description copied from interface:ValAppend the SQL checking the size of this value.- Specified by:
appendSizein interfaceVal
-
getAlias
public java.lang.String getAlias()
Description copied from interface:ValueReturn select item alias
-
setAlias
public void setAlias(java.lang.String alias)
Description copied from interface:ValueSet select item alias
-
getSelectAs
public Value getSelectAs()
Description copied from interface:ValueReturn 'this' concrete class if alias is set, otherwise null- Specified by:
getSelectAsin interfaceVal- Specified by:
getSelectAsin interfaceValue
-
-