Class DBExistsExpr
java.lang.Object
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.expr.compare.DBCompareExpr
org.apache.empire.db.expr.compare.DBExistsExpr
- All Implemented Interfaces:
DBPreparable
This class is used for building up the SQL-Command for the EXISTS syntax.
-
Field Summary
FieldsFields 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 DBExistsExpr object set the specified parameters to this object.DBExistsExpr(DBCommandExpr cmd, DBCompareExpr compareExpr) Constructs a DBExistsExpr object set the specified parameters to this object. -
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.Copy Commandfinal DBDatabaseReturns the current DBDatabase object.Returns the underlying rowset containing this columnbooleanisConstraintOn(DBColumnExpr colExpr) Returns whether the constraint is on the given columnbooleanisMutuallyExclusive(DBCompareExpr other) Returns wheter the constraint should replace another one or not.voidprepareParams(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.Methods inherited from class org.apache.empire.db.expr.compare.DBCompareExpr
and, not, orMethods inherited from class org.apache.empire.db.DBObject
checkParamNull
-
Field Details
-
cmd
-
compareExpr
-
-
Constructor Details
-
DBExistsExpr
Constructs a DBExistsExpr object set the specified parameters to this object.- Parameters:
cmd- the DBCommandExpr object
-
DBExistsExpr
Constructs a DBExistsExpr object set the specified parameters to this object.- Parameters:
cmd- the DBCommandExpr objectcompareExpr- The expression to append to the end of the exists statement
-
-
Method Details
-
getDatabase
Returns the current DBDatabase object.- Specified by:
getDatabasein classDBObject- Returns:
- the current DBDatabase object
-
getRowSet
Returns the underlying rowset containing this column- Specified by:
getRowSetin classDBCompareExpr- Returns:
- a column used for this expression
-
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!- Parameters:
cmd- the command to which to add the parametersparent- the parent expression holding the value
-
copy
Copy Command- Specified by:
copyin classDBCompareExpr- Parameters:
newCmd- the new command object- Returns:
- the cloned compare 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- See Also:
-
addSQL
Creates the SQL-Command. -
isMutuallyExclusive
Returns wheter the constraint should replace another one or not.- Specified by:
isMutuallyExclusivein classDBCompareExpr- Returns:
- true it the constraints are mutually exclusive or false otherwise
-
isConstraintOn
Returns whether the constraint is on the given column- Specified by:
isConstraintOnin classDBCompareExpr- Returns:
- true it the constraint is on the given column or false otherwise
-