public abstract class ConditionalQuery<T extends ConditionalQuery<T>> extends AbstractQuery
WHERE clause.| Modifier and Type | Field and Description |
|---|---|
protected List<Expression> |
conditions |
| Constructor and Description |
|---|
ConditionalQuery() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendConditions(@NonNull StringBuilder sb) |
T |
where(@NonNull String column,
@NonNull Object value)
Adds a
WHERE condition that checks that specified column has specified value. |
T |
whereExpr(@NonNull String expr,
Object... params)
Adds an SQL expression as a
WHERE condition, like `mycolumn` / 100 = ? |
T |
whereNull(@NonNull String column)
Adds a
WHERE condition that checks that specified column has a NULL value. |
T |
whereNullable(@NonNull String column,
Object value)
Adds a
WHERE condition that checks that specified column has specified value, which can be NULL. |
getParams, getSQL, prepareStatement, prepareStatement, query, queryAndMap, queryAndMapAll, update, update, updateWithKeys, updateWithKeysAndMap, updateWithKeysAndMapAllprotected final List<Expression> conditions
public final T where(@NonNull @NonNull String column, @NonNull @NonNull Object value)
WHERE condition that checks that specified column has specified value.
Conditions are chained with AND operation.column - Column name.value - Value.public final T whereExpr(@NonNull @NonNull String expr, @NonNull Object... params)
WHERE condition, like `mycolumn` / 100 = ?.
Conditions are chained with AND operation.expr - SQL expression.params - Expression parameters (filled in placeholders ?).public final T whereNull(@NonNull @NonNull String column)
WHERE condition that checks that specified column has a NULL value.
Conditions are chained with AND operation.column - Column name.public final T whereNullable(@NonNull @NonNull String column, Object value)
WHERE condition that checks that specified column has specified value, which can be NULL.
Conditions are chained with AND operation.column - Column name.value - Value to add.protected void appendConditions(@NonNull
@NonNull StringBuilder sb)
Copyright © 2021. All rights reserved.