public class Where extends Object implements StatementPopulator
Constructor and Description |
---|
Where()
Creates an object with no filters.
|
Where(String columnName,
Operator operator,
BigDecimal value)
Create a new instance of a
Where object
containing one predicate. |
Where(String columnName,
Operator operator,
Boolean value)
Create a new instance of a
Where object
containing one predicate. |
Where(String columnName,
Operator operator,
LocalDateTime value)
Create a new instance of a
Where object
containing one predicate. |
Where(String columnName,
Operator operator,
Long value)
Create a new instance of a
Where object
containing one predicate. |
Where(String columnName,
Operator operator,
String value)
Create a new instance of a
Where object
containing one predicate. |
Where(Where subWhere)
Creates a new
Where instance that is grouped,
that is, when the SQL where clause is generated, whatever is
inside the passed where instance will be wrapped inside
parentheses. |
Modifier and Type | Method and Description |
---|---|
Where |
and(String columnName,
Operator operator,
BigDecimal value)
Add a new predicate to the existing object by connecting the
existing predicates to the new one with a logical and.
|
Where |
and(String columnName,
Operator operator,
Boolean value)
Add a new predicate to the existing object by connecting the
existing predicates to the new one with a logical and.
|
Where |
and(String columnName,
Operator operator,
LocalDateTime value)
Add a new predicate to the existing object by connecting the
existing predicates to the new one with a logical and.
|
Where |
and(String columnName,
Operator operator,
Long value)
Add a new predicate to the existing object by connecting the
existing predicates to the new one with a logical and.
|
Where |
and(String columnName,
Operator operator,
String value)
Add a new predicate to the existing object by connecting the
existing predicates to the new one with a logical and.
|
Where |
and(Where subWhere)
Add a new predicate to the existing object by connecting the
existing predicates to the passed argument with a logical and
operation.
|
static Where |
isNotNull(String columnName)
Creates a new object with a single predicate testing whether
a column is not null.
|
static Where |
isNull(String columnName)
Creates a new object with a single predicate testing whether
a column is null.
|
Where |
or(String columnName,
Operator operator,
BigDecimal value)
Add a new predicate to the existing object by connecting the
existing predicates to the new one with a logical or.
|
Where |
or(String columnName,
Operator operator,
Boolean value)
Add a new predicate to the existing object by connecting the
existing predicates to the new one with a logical or.
|
Where |
or(String columnName,
Operator operator,
LocalDateTime value)
Add a new predicate to the existing object by connecting the
existing predicates to the new one with a logical or.
|
Where |
or(String columnName,
Operator operator,
Long value)
Add a new predicate to the existing object by connecting the
existing predicates to the new one with a logical or.
|
Where |
or(String columnName,
Operator operator,
String value)
Add a new predicate to the existing object by connecting the
existing predicates to the new one with a logical or.
|
Where |
or(Where subWhere)
Add a new predicate to the existing object by connecting the
existing predicates to the passed argument with a logical or
operation.
|
void |
populate(PreparedStatement preparedStatement) |
String |
render()
The SQL that makes up the where clause this object represents.
|
static Where |
where()
Factory method equivalent to
new Where() |
static Where |
where(String columnName,
Operator operator,
BigDecimal value)
Factory method equivalent to
new Where(columnName, operator, value) . |
static Where |
where(String columnName,
Operator operator,
Boolean value)
Factory method equivalent to
new Where(columnName, operator, value) . |
static Where |
where(String columnName,
Operator operator,
LocalDateTime value)
Factory method equivalent to
new Where(columnName, operator, value) . |
static Where |
where(String columnName,
Operator operator,
Long value)
Factory method equivalent to
new Where(columnName, operator, value) . |
static Where |
where(String columnName,
Operator operator,
String value)
Factory method equivalent to
new Where(columnName, operator, value) . |
static Where |
where(Where subWhere)
Factory method equivalent to
new Where(subWhere) . |
public Where()
public Where(Where subWhere)
Where
instance that is grouped,
that is, when the SQL where clause is generated, whatever is
inside the passed where instance will be wrapped inside
parentheses.subWhere
- The predicates to be wrappedpublic Where(String columnName, Operator operator, Boolean value)
Where
object
containing one predicate.columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where(String columnName, Operator operator, Long value)
Where
object
containing one predicate.columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where(String columnName, Operator operator, String value)
Where
object
containing one predicate.columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where(String columnName, Operator operator, BigDecimal value)
Where
object
containing one predicate.columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where(String columnName, Operator operator, LocalDateTime value)
Where
object
containing one predicate.columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic static Where where()
new Where()
public static Where where(Where subWhere)
new Where(subWhere)
.subWhere
- an existing predicate that will be grouped parenthetically
within the new objectpublic static Where where(String columnName, Operator operator, Boolean value)
new Where(columnName, operator, value)
.
Creates a new Where
object containing one predicate.columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic static Where where(String columnName, Operator operator, Long value)
new Where(columnName, operator, value)
.
Creates a new Where
object containing one predicate.columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic static Where where(String columnName, Operator operator, String value)
new Where(columnName, operator, value)
.
Creates a new Where
object containing one predicate.columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic static Where where(String columnName, Operator operator, BigDecimal value)
new Where(columnName, operator, value)
.
Creates a new Where
object containing one predicate.columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic static Where where(String columnName, Operator operator, LocalDateTime value)
new Where(columnName, operator, value)
.
Creates a new Where
object containing one predicate.columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic static Where isNull(String columnName)
columnName
- The column to test for a null value.public static Where isNotNull(String columnName)
columnName
- The column to test for a not null value.public Where and(Where subWhere)
subWhere
- the new predicate to addpublic Where and(String columnName, Operator operator, Long value)
columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where and(String columnName, Operator operator, BigDecimal value)
columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where and(String columnName, Operator operator, String value)
columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where and(String columnName, Operator operator, LocalDateTime value)
columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where and(String columnName, Operator operator, Boolean value)
columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where or(Where subWhere)
subWhere
- the new predicate to addpublic Where or(String columnName, Operator operator, Long value)
columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where or(String columnName, Operator operator, BigDecimal value)
columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where or(String columnName, Operator operator, String value)
columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where or(String columnName, Operator operator, Boolean value)
columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic Where or(String columnName, Operator operator, LocalDateTime value)
columnName
- The column name the predicate applies tooperator
- The operation used to evaluate the predicatevalue
- The value to compare the column values againstpublic String render()
public void populate(PreparedStatement preparedStatement) throws SQLException
populate
in interface StatementPopulator
SQLException
Copyright © 2019. All rights reserved.