Class BooleanLiteral
java.lang.Object
org.datanucleus.store.rdbms.sql.expression.SQLExpression
org.datanucleus.store.rdbms.sql.expression.BooleanExpression
org.datanucleus.store.rdbms.sql.expression.BooleanLiteral
- All Implemented Interfaces:
SQLLiteral
Representation of a Boolean literal in a Query.
-
Nested Class Summary
Nested classes/interfaces inherited from class SQLExpression
SQLExpression.ColumnExpressionList -
Field Summary
FieldsFields inherited from class BooleanExpression
hasClosureFields inherited from class SQLExpression
lowestOperator, mapping, parameterName, st, stmt, subExprs, table -
Constructor Summary
ConstructorsConstructorDescriptionBooleanLiteral(SQLStatement stmt, JavaTypeMapping mapping, Boolean value) Creates a boolean literal with the specified value, using the provided mapping.BooleanLiteral(SQLStatement stmt, JavaTypeMapping mapping, Object value, String parameterName) Creates a boolean literal with the specified value, using the provided mapping. -
Method Summary
Modifier and TypeMethodDescriptionand(SQLExpression expr) Conditional AND.eor(SQLExpression expr) Exclusive OReq(SQLExpression expr) Equality operator (equals to)getValue()Accessor to the literal valueior(SQLExpression expr) Conditional OR.ne(SQLExpression expr) Not equality operator (not equals to)not()Logical complementvoidsetJavaTypeMapping(JavaTypeMapping mapping) voidMethod to set this literal as not being a parameter.protected voidMethods inherited from class BooleanExpression
hasClosure, in, invoke, negMethods inherited from class SQLExpression
add, bitAnd, bitOr, cast, com, distinct, div, encloseInParentheses, ge, getJavaTypeMapping, getLowestOperator, getNumberOfSubExpressions, getParameterName, getSQLStatement, getSQLTable, getSubExpression, gt, is, isParameter, le, lt, mod, mul, sub, toSQLText, unDistinct
-
Field Details
-
value
-
-
Constructor Details
-
BooleanLiteral
public BooleanLiteral(SQLStatement stmt, JavaTypeMapping mapping, Object value, String parameterName) Creates a boolean literal with the specified value, using the provided mapping. The boolean literal DOESN'T have closure using this constructor. This constructor will use the provided mapping in determining whether to put "TRUE"/"1=0", or "1"/"0" or "Y"/"N" in the SQL.- Parameters:
stmt- The SQL statementmapping- the mappingvalue- the valueparameterName- Parameter name (represented as JDBC "?")
-
BooleanLiteral
Creates a boolean literal with the specified value, using the provided mapping. The boolean expression has closure using this constructor. This constructor doesn't take into account the type of the mapping and how a boolean may be stored, just creating a literal (TRUE) and the SQL will simply be "TRUE"/"1=0".- Parameters:
stmt- The SQL statementmapping- the mappingvalue- the boolean value
-
-
Method Details
-
setJavaTypeMapping
- Overrides:
setJavaTypeMappingin classSQLExpression
-
getValue
Description copied from interface:SQLLiteralAccessor to the literal value- Specified by:
getValuein interfaceSQLLiteral- Returns:
- the value of the literal
-
and
Description copied from class:SQLExpressionConditional AND. Evaluates its right-hand operand only if the value of its left-hand operand is true.- Overrides:
andin classBooleanExpression- Parameters:
expr- the right-hand operand- Returns:
- the result value is true if both operand values are true; otherwise, the result is false.
-
eor
Description copied from class:SQLExpressionExclusive OR- Overrides:
eorin classBooleanExpression- Parameters:
expr- the right-hand operand- Returns:
- the result value is the bitwise exclusive OR of the operand values.
-
ior
Description copied from class:SQLExpressionConditional OR. Evaluates its right-hand operand only if the value of its left-hand operand is false.- Overrides:
iorin classBooleanExpression- Parameters:
expr- the right-hand operand- Returns:
- the result value is false if both operand values are false; otherwise, the result is true.
-
not
Description copied from class:SQLExpressionLogical complement- Overrides:
notin classBooleanExpression- Returns:
- the result value is false if operand is true; otherwise, the result is true.
-
eq
Description copied from class:SQLExpressionEquality operator (equals to)- Overrides:
eqin classBooleanExpression- Parameters:
expr- the right-hand operand- Returns:
- The type of an equality expression is a boolean
-
ne
Description copied from class:SQLExpressionNot equality operator (not equals to)- Overrides:
nein classBooleanExpression- Parameters:
expr- the right-hand operand- Returns:
- The type of an equality expression is a boolean
-
setNotParameter
public void setNotParameter()Description copied from interface:SQLLiteralMethod to set this literal as not being a parameter. If the literal if not currently a parameter then does nothing. Updates any underlying SQL to have the value.- Specified by:
setNotParameterin interfaceSQLLiteral
-
setStatement
protected void setStatement()
-