Package org.apache.empire.db.expr.column
Class DBParenthesisExpr
java.lang.Object
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.DBColumnExpr
org.apache.empire.db.expr.column.DBParenthesisExpr
- All Implemented Interfaces:
Unwrappable<DBColumnExpr>,ColumnExpr,DBPreparable
public class DBParenthesisExpr
extends DBColumnExpr
implements DBPreparable, Unwrappable<DBColumnExpr>
This class allows column renaming in SQL.
There is no need to explicitly create instances of this class.
Instead use DBColumnExpr.as(String)
-
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
ConstructorsConstructorDescriptionConstructs a DBAliasExpr object combine the DBColumnExpr object with the alias name. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReferencedColumns(Set<DBColumn> list) Internal function to obtain all DBColumnExpr-objects used by this expression.voidaddSQL(DBSQLBuilder sql, long context) Creates the SQL-Command adds the alias name to the SQL-Command.This function set the alias name to the XML tag.booleanOverrides the equals methodfinal DBDatabaseReturns the current DBDatabase object.Returns the data type of the DBColumnExpr object.Returns the enum type of this Expression (if any)getName()This helper function returns the alias name.Returns the underlying rowsetReturns the DBColunm object.booleanForward to expressionbooleanIndicates that we are actually an expression wrappervoidprepareParams(DBCommand cmd, DBExpr parent) Prepares an expression for a query This function is called by DBCommand in order to add values as query parameters instead of being literally included in the sql statement Please Note: This function is internally called.toString()For Debuggingunwrap()Returns the underlying column expression.Methods 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, trim, trimLeft, trimRight, trunc, upper, when, yearMethods inherited from class org.apache.empire.db.DBObject
checkParamNull
-
Constructor Details
-
DBParenthesisExpr
Constructs a DBAliasExpr object combine the DBColumnExpr object with the alias name.- Parameters:
expr- an DBColumnExpr object, one column
-
-
Method Details
-
getDatabase
Returns the current DBDatabase object.- Specified by:
getDatabasein classDBObject- Returns:
- the current DBDatabase object
-
getDataType
Returns the data type of the DBColumnExpr object.- Specified by:
getDataTypein interfaceColumnExpr- Specified by:
getDataTypein classDBColumnExpr- Returns:
- the data type
- See Also:
-
getEnumType
Returns the enum type of this Expression (if any)- Specified by:
getEnumTypein interfaceColumnExpr- Returns:
- the enum type or null
-
getName
This helper function returns the alias name.- Specified by:
getNamein interfaceColumnExpr- Specified by:
getNamein classDBColumnExpr- Returns:
- the alias name
-
getRowSet
Returns the underlying rowset- Specified by:
getRowSetin classDBColumnExpr- Returns:
- a column used for this expression
-
getUpdateColumn
Returns the DBColunm object.- Specified by:
getUpdateColumnin interfaceColumnExpr- Specified by:
getUpdateColumnin classDBColumnExpr- Returns:
- the DBColunm object
-
isWrapper
public boolean isWrapper()Indicates that we are actually an expression wrapper- Specified by:
isWrapperin interfaceUnwrappable<DBColumnExpr>- Returns:
- true
-
unwrap
Returns the underlying column expression.- Specified by:
unwrapin interfaceUnwrappable<DBColumnExpr>- Returns:
- the underlying column expression
-
isAggregate
public boolean isAggregate()Forward to expression- Specified by:
isAggregatein classDBColumnExpr- Returns:
- false
-
equals
Overrides the equals method -
prepareParams
Description copied from interface:DBPreparablePrepares an expression for a query This function is called by DBCommand in order to add values as query parameters instead of being literally included in the sql statement Please Note: This function is internally called. Do not call yourself!- Specified by:
prepareParamsin interfaceDBPreparable- Parameters:
cmd- the command to which to add the parametersparent- the parent expression holding the value
-
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- See Also:
-
addSQL
Creates the SQL-Command adds the alias name to the SQL-Command. -
toString
For Debugging- Overrides:
toStringin classDBColumnExpr
-
addXml
This function set the alias name to the XML tag.- Specified by:
addXmlin classDBColumnExpr- Parameters:
parent- the parent element to which to append the column descriptionflags- currently not used- Returns:
- the XML tag (with the alias name)
-