T
- the type held by the column being comparedpublic class WherePredicate<T> extends Object
Most users of hrorm will have no need to directly use this.
Constructor and Description |
---|
WherePredicate(String columnName,
boolean nullityCheck) |
WherePredicate(String columnName,
Operator operator,
T value,
org.hrorm.PreparedStatementSetter<T> setter) |
WherePredicate(String columnName,
org.hrorm.PreparedStatementSetter<T> setter,
List<T> elements,
boolean in) |
Modifier and Type | Method and Description |
---|---|
static WherePredicate<BigDecimal> |
forBigDecimal(String columnName,
Operator operator,
BigDecimal value) |
static WherePredicate<Boolean> |
forBoolean(String columnName,
Operator operator,
Boolean value) |
static <V> WherePredicate<V> |
forGeneric(String name,
Operator operator,
V value,
GenericColumn<V> column) |
static WherePredicate<Instant> |
forInstant(String columnName,
Operator operator,
Instant value) |
static WherePredicate<Long> |
forLong(String columnName,
Operator operator,
Long value) |
static WherePredicate<String> |
forString(String columnName,
Operator operator,
String value) |
String |
render(String prefix)
Creates a string representing a SQL snippet that can be used to build
a prepared statement.
|
int |
setValue(int index,
PreparedStatement statement)
Applies the value held by this object to the passed statement.
|
public WherePredicate(String columnName, boolean nullityCheck)
public WherePredicate(String columnName, Operator operator, T value, org.hrorm.PreparedStatementSetter<T> setter)
public static WherePredicate<Boolean> forBoolean(String columnName, Operator operator, Boolean value)
public static WherePredicate<Long> forLong(String columnName, Operator operator, Long value)
public static WherePredicate<String> forString(String columnName, Operator operator, String value)
public static WherePredicate<BigDecimal> forBigDecimal(String columnName, Operator operator, BigDecimal value)
public static WherePredicate<Instant> forInstant(String columnName, Operator operator, Instant value)
public static <V> WherePredicate<V> forGeneric(String name, Operator operator, V value, GenericColumn<V> column)
public String render(String prefix)
prefix
- The prefix to give to the column name to specify its table.public int setValue(int index, PreparedStatement statement) throws SQLException
index
- the index of the variable to be setstatement
- the statement being populatedPreparedStatement
, which is
how far the index must be advancedSQLException
- on an errorCopyright © 2019. All rights reserved.