|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.amrhassan.sqlbuilder.restrictions.SqlRestrictions
public final class SqlRestrictions
A one-stop place for all the possible SQL restrictions. Most restrictions are provided in two flavours, one that automatically sets the restriction operands to the '?' character, the other needs the operands to be specified explicitly as Strings.
| Method Summary | |
|---|---|
static SqlRestriction |
and(Collection<SqlRestriction> restrictions)
AND combination of restrictions |
static SqlRestriction |
and(SqlRestriction... restrictions)
AND combination of restrictions |
static SqlRestriction |
between(String field)
The specified field falls inside a range; (field BETWEEN ? AND ?). |
static SqlRestriction |
between(String field,
String lowerBound,
String upperBound)
The specified field falls inside a range; (field BETWEEN lowerBound AND upperBound). |
static SqlRestriction |
eq(String field)
Equality between the provided field name and '?' |
static SqlRestriction |
eq(String lhs,
String rhs)
Equality between two operands (lhs = rhs). |
static SqlRestriction |
gt(String field)
The specified field is greater-than another operand specified by a '?' character |
static SqlRestriction |
gte(String field)
The specified field is greater-than-or-equal to another operand specified by a '?' character |
static SqlRestriction |
in(String field,
int operandCount)
The specified field is in a list of provided parameters; (field IN (?,?,?,...)) |
static SqlRestriction |
in(String field,
SelectSqlStatement selectStatement)
The specified field lies in the result of the provided sub-query |
static SqlRestriction |
lt(String field)
The specified field is less-than another operand specified by a '?' character |
static SqlRestriction |
lte(String field)
The specified field is less-than-or-equal to another operand specified by a '?' character |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SqlRestriction eq(String field)
public static SqlRestriction eq(String lhs,
String rhs)
PreparedStatement.
public static SqlRestriction and(SqlRestriction... restrictions)
public static SqlRestriction and(Collection<SqlRestriction> restrictions)
public static SqlRestriction between(String field)
public static SqlRestriction between(String field,
String lowerBound,
String upperBound)
PreparedStatement
public static SqlRestriction in(String field,
int operandCount)
field - The field name or its aliasoperandCount - The number of operands in the list of possible values
public static SqlRestriction in(String field,
SelectSqlStatement selectStatement)
field - The field name or its aliasselectStatement - The sub-querypublic static SqlRestriction lte(String field)
field - The field name or its aliaspublic static SqlRestriction lt(String field)
field - The field name or its aliaspublic static SqlRestriction gte(String field)
field - The field name or its aliaspublic static SqlRestriction gt(String field)
field -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||