Package org.apache.empire.db.expr.column
Class DBCaseMapExpr
java.lang.Object
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.DBColumnExpr
org.apache.empire.db.expr.column.DBCaseExpr
org.apache.empire.db.expr.column.DBCaseMapExpr
- All Implemented Interfaces:
ColumnExpr
This class is used to create a SQL CASE constraint in the form of
case {expr} when {value1} then {result1}
when {value2} then {result2}
...
else {defaultResult} end"
There is no need to explicitly create instances of this class.
Instead use DBDatabase.caseMap(DBColumnExpr, Object, Object, Object)
- Author:
- doebele
-
Field Summary
Fields inherited from class org.apache.empire.db.DBColumnExpr
attributes, beanPropertyName, optionsFields inherited from class org.apache.empire.db.DBExpr
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESIS, CTX_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionDBCaseMapExpr(DBColumnExpr caseExpr, Object cmpVal, Object trueValue, Object elseValue) DBCaseMapExpr(DBColumnExpr caseExpr, Object cmpVal1, Object trueValue1, Object cmpVal2, Object trueValue2, Object elseValue) DBCaseMapExpr(DBColumnExpr caseExpr, Map<? extends Object, ? extends Object> valueMap, Object elseValue) constructs a DBCaseSelectExpr expr -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReferencedColumns(Set<DBColumn> list) Internal function to obtain all DBColumnExpr-objects used by this expression.voidaddSQL(DBSQLBuilder sql, long context) Used to build the SQL command.booleanReturns true if other is equal to this expressiongetName()Returns the column name for this column expression.Methods inherited from class org.apache.empire.db.expr.column.DBCaseExpr
addXml, getDatabase, getDataType, getEnumType, getRowSet, getSourceColumnExpr, getUpdateColumn, init, initDataTypeFromValue, isAggregate, isNotNull, isNullMethods inherited from class org.apache.empire.db.DBColumnExpr
abs, aggregate, append, as, as, asc, avg, ceiling, cmp, coalesce, concat, concat, contains, convertTo, convertTo, count, countDistinct, day, decode, decode, decode, decode, decode, decode, decodeEnum, decodeSort, desc, divideBy, floor, format, function, getAttribute, getAttribute, getBeanPropertyName, getControlType, getDefaultSortOrder, getExprFromPhrase, getExprFromPhrase, getIgnoreCaseExpr, getJavaType, getNumberType, getOptions, getSourceColumn, getTitle, in, in, in, indexOf, indexOf, indexOf, is, isBetween, isCaseSensitive, isGreaterThan, isLessOrEqual, isLiteralValue, isMoreOrEqual, isNot, isNotBetween, isSmallerThan, length, like, like, likeLower, likeUpper, lower, max, min, minus, minus, modulo, month, multiplyWith, notContains, notIn, notIn, notIn, notLike, nvl, on, parenthesis, plus, plus, prepend, qualified, replace, reverse, round, setAttribute, setBeanPropertyName, setControlType, setDefaultSortOrder, setOptions, setTitle, stringAgg, stringAgg, substring, substring, substring, substring, substring, substring, sum, toChar, toChar, toString, trim, trimLeft, trimRight, trunc, upper, when, yearMethods inherited from class org.apache.empire.db.DBObject
checkParamNull
-
Constructor Details
-
DBCaseMapExpr
public DBCaseMapExpr(DBColumnExpr caseExpr, Map<? extends Object, ? extends Object> valueMap, Object elseValue) constructs a DBCaseSelectExpr expr- Parameters:
caseExpr- the case expressionvalueMap- the value MapelseValue- the else Expression
-
DBCaseMapExpr
-
DBCaseMapExpr
-
-
Method Details
-
getName
Description copied from class:DBColumnExprReturns the column name for this column expression. The name must contain only alphanumeric characters and the underscore. For SQL functions this name may be generated. However subsequent calls to this function for the same object instance must return the same string.- Specified by:
getNamein interfaceColumnExpr- Specified by:
getNamein classDBColumnExpr- Returns:
- the column name
-
equals
Returns true if other is equal to this expression -
addReferencedColumns
Description copied from class:DBExprInternal function to obtain all DBColumnExpr-objects used by this expression.- Specified by:
addReferencedColumnsin classDBExpr- Parameters:
list- list to which all used column expressions must be added
-
addSQL
Description copied from class:DBExprUsed to build the SQL command. SQL for this expression must be appended to StringBuilder.
-