public class BooleanColumn extends BooleanExpression implements ColumnProvider
This class adds the necessary methods to use a boolean column like a boolean expression.
Internally the class uses an AbsractColumn to store the column and overrides methods in BooleanExpression to insert the column into the expression.
Generally you get a BooleanColumn using
RowDefinition.column(DBBoolean).
Support DBvolution at Patreon
RowDefinition,
AbstractColumn,
BooleanExpression| Constructor and Description |
|---|
BooleanColumn(RowDefinition row,
Boolean field)
Create a BooleanColumn for the supplied field of the supplied row
|
BooleanColumn(RowDefinition row,
DBBoolean field)
Create a BooleanColumn for the supplied field of the supplied row
|
| Modifier and Type | Method and Description |
|---|---|
BooleanColumn |
copy()
A Complete Copy Of This DBValue.
|
AbstractColumn |
getColumn()
Returns the AbstractColumn from this ColumnProvider.
|
Set<DBRow> |
getTablesInvolved()
Returns a Set of the DBRow instances involved in this expression.
|
BooleanExpression |
is(DBBoolean boolColumn)
Create an expression to compare this column to the other column using
EQUALS.
|
boolean |
isAggregator()
Returns TRUE if this expression is an Aggregator like SUM() or LEAST().
|
boolean |
isBooleanStatement()
Indicates whether the result is a boolean statement or boolean value.
|
boolean |
isPurelyFunctional()
Indicates whether or not the expression includes table columns.
|
void |
setUseTableAlias(boolean useTableAlias)
Indicates whether the ColumnProvider should use the table alias during
query creation.
|
String |
toSQLString(DBDefinition db)
Produces the snippet provided by this class.
|
allOf, and, anyOf, asExpressionColumn, count, falseExpression, getIncludesNull, getQueryableDatatypeForExpressionValue, ifThenElse, ifThenElse, ifThenElse, ifThenElse, ifThenElse, ifThenElse, ifThenElse, ifThenElse, ifThenElse, integerValue, is, is, is, isNot, isNot, isNotNull, isNotNull, isNotNull, isNull, isNull, isNull, isRelationship, negate, noneOf, not, notAllOf, numberValue, or, seekGreaterThan, seekGreaterThan, seekGreaterThan, seekGreaterThan, seekLessThan, seekLessThan, seekLessThan, seekLessThan, someButNotAllOf, stringResult, trueExpression, value, value, xorpublic BooleanColumn(RowDefinition row, Boolean field)
row - the row that the field belongs tofield - the field that represents the columnpublic BooleanColumn(RowDefinition row, DBBoolean field)
row - the row that the field belongs tofield - the field that represents the columnpublic String toSQLString(DBDefinition db)
DBExpressionThis is only used internally.
If you are extending DBvolution and adding a new function this is the place to format the information for use in SQL. A DBDefinition instance is provided to supply context and so your SQL can used on multiple database engines.
toSQLString in interface DBExpressiontoSQLString in class BooleanExpressiondb - the target database
Support DBvolution at Patreon
public BooleanColumn copy()
DBExpressionImmutability in DBvolution is maintain by internally copying objects.
This method enables immutability by performing a deep copy of the object.
Singletons may return themselves but all other objects must return a new instance with copies of all mutable fields.
Support DBvolution at Patreon
copy in interface DBExpressioncopy in interface BooleanResultcopy in class BooleanExpressionDBValuepublic AbstractColumn getColumn()
ColumnProviderSupport DBvolution at Patreon
getColumn in interface ColumnProviderpublic Set<DBRow> getTablesInvolved()
DBExpressionUsed by QueryGraph to plot the connections between tables and avoid cartesian joins.
Support DBvolution at Patreon
getTablesInvolved in interface DBExpressiongetTablesInvolved in class BooleanExpressionpublic void setUseTableAlias(boolean useTableAlias)
ColumnProvider
the standard implementation is
this.column.setUseTableAlias(useTableAlias); and passes the boolean
along to the underlying AbstractColumn
setUseTableAlias in interface ColumnProvideruseTableAlias - true or falsepublic boolean isPurelyFunctional()
DBExpressionPurely functional expressions use only in-built functions or literal values to produce results and do not require data from tables.
Some databases, notably MS SQLServer, can not group purely functional expressions.
Support DBvolution at Patreon
isPurelyFunctional in interface DBExpressionisPurelyFunctional in class BooleanExpressionpublic boolean isAggregator()
DBExpressionSubclasses must implement this method returning TRUE if the expression will combine the results of several rows to produce a result. If the expression relies on subexpressions, then the isAggregator method must return TRUE if the subexpressions include an aggregator.
Aggregators collect several rows together to produce a single result. Examples are MAX, MIN, and AVERAGE.
They are only appropriate in the SELECT clause and generally require the GROUP BY clause to be useful.
Aggregators are used with DBReport. Aggregator expressions are
included in the SELECT clause but excluded from the GROUP BY clause.
Support DBvolution at Patreon
isAggregator in interface DBExpressionisAggregator in class BooleanExpressionpublic BooleanExpression is(DBBoolean boolColumn)
boolColumn - an instance to compare to
Support DBvolution at Patreon
public boolean isBooleanStatement()
BooleanResultA boolean statement is a a comparison like 1=1 which results in a boolean value and is used in the where clause. Conversely a boolean value is the database representation TRUE or FALSE.
The distinction is subtle but required to deal with databases which do not have a full-feature boolean datatype.
Support DBvolution at Patreon
isBooleanStatement in interface BooleanResultisBooleanStatement in class BooleanExpressionCopyright © 2017. All Rights Reserved.