Package org.apache.empire.db.expr.column
Class DBCaseExpr
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
- All Implemented Interfaces:
ColumnExpr
- Direct Known Subclasses:
DBCaseMapExpr,DBCaseWhenExpr
This class represents a SQL case expression
like "case when ?=A then X else Y end"
or "case ? when A then X else Y end"
This abstract class is implemented by DBCaseMapExpr and DBCaseWhenExpr
- 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
ConstructorsModifierConstructorDescriptionprotectedDBCaseExpr(DBColumnExpr caseExpr) protectedDBCaseExpr(DBDatabase db) -
Method Summary
Modifier and TypeMethodDescriptionAdd a description of this column with relevant metadata to the supplied parent XML Element.final DBDatabaseReturns the database object to which this object belongs to.Returns the data type of this column expression.Returns the enum type for this columnReturns the underlying rowset containing this column For functions involving none or more than one physical column this function return the first oneprotected DBColumnExprgetSourceColumnExpr(Collection<?> values, Object elseValue) Returns the underlying physical column.protected voidInit case expression.protected voidinitDataTypeFromValue(Object value) booleanIndicates whether this function is an aggregate (sum, min, max, avg, ...) or notprotected booleanhelper to check if an expression is not nullprotected booleanhelper to check if an expression is nullMethods 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, getName, 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.DBExpr
addReferencedColumns, addSQLMethods inherited from class org.apache.empire.db.DBObject
checkParamNull
-
Constructor Details
-
DBCaseExpr
-
DBCaseExpr
-
-
Method Details
-
getDatabase
Description copied from class:DBObjectReturns the database object to which this object belongs to. For the database object itself this function will return the this pointer.- Specified by:
getDatabasein classDBObject- Returns:
- the database object
-
getDataType
Description copied from class:DBColumnExprReturns the data type of this column expression.- Specified by:
getDataTypein interfaceColumnExpr- Specified by:
getDataTypein classDBColumnExpr- Returns:
- the expressions data type
- See Also:
-
getEnumType
Description copied from interface:ColumnExprReturns the enum type for this column- Returns:
- the enum type
-
getRowSet
Description copied from class:DBColumnExprReturns the underlying rowset containing this column For functions involving none or more than one physical column this function return the first one- Specified by:
getRowSetin classDBColumnExpr- Returns:
- a column used for this expression
-
getUpdateColumn
Description copied from class:DBColumnExprReturns the underlying physical column. For functions involving none or more than one physical column this function returns null.- Specified by:
getUpdateColumnin interfaceColumnExpr- Specified by:
getUpdateColumnin classDBColumnExpr- Returns:
- the underlying column
-
isAggregate
public boolean isAggregate()Description copied from class:DBColumnExprIndicates whether this function is an aggregate (sum, min, max, avg, ...) or not- Specified by:
isAggregatein classDBColumnExpr- Returns:
- true if the column expression represents an aggregate
-
addXml
Description copied from class:DBColumnExprAdd a description of this column with relevant metadata to the supplied parent XML Element.- Specified by:
addXmlin classDBColumnExpr- Parameters:
parent- the parent element to which to append the column descriptionflags- currently not used- Returns:
- the newly created child element
-
isNull
helper to check if an expression is null- Parameters:
value- the value to check- Returns:
- true if null or false otherwise
-
isNotNull
helper to check if an expression is not null- Parameters:
value- the value- Returns:
- true if not null or false otherwise
-
init
Init case expression. Must be called from all constructors!- Parameters:
valueMap- the value or conditions mapelseValue- the else value
-
getSourceColumnExpr
-
initDataTypeFromValue
-