|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.basedb.core.query.Restrictions
public class Restrictions
A factory class to create restrictions.
| Constructor Summary | |
|---|---|
Restrictions()
|
|
| Method Summary | ||
|---|---|---|
static Restriction |
and(Restriction... r)
Combine one or more restrictions with AND: new restriction = r[0] AND r[1] AND ... |
|
static Restriction |
between(Expression e,
Expression low,
Expression high)
Compare if one expression falls between two other expressions: new expression = low <= e AND e < high. |
|
static Restriction |
betweenInclusive(Expression e,
Expression low,
Expression high)
Compare if one expression falls between two other expressions (inclusive): new expression = low <= e AND e <= high. |
|
private static
|
copyNotNulls(T[] source,
T[] dest)
|
|
private static int |
countNotNulls(Object[] array)
|
|
static Restriction |
eq(Expression e1,
Expression e2)
Compare if two expressions are equal: new restriction = e1 == e2. |
|
private static int |
getFirstNull(Object[] array)
Test if there is null in the array. |
|
static Restriction |
gt(Expression e1,
Expression e2)
Compare if one expression is greater than another: new restriction = e1 > e2. |
|
static Restriction |
gteq(Expression e1,
Expression e2)
Compare if one expression is greater than or equal to another: new restriction = e1 >= e2. |
|
static Restriction |
in(Expression e1,
Expression... e2)
Check if an expression is contained in a set of other expressions: e1 IN (e2[0], e2[1], ...) |
|
static Restriction |
like_in(Expression e1,
Expression... e2)
Check if one expression matches any expressions in an array: (e1 LIKE e2.1) OR (e1 LIKE e2.2) OR .... |
|
static Restriction |
like(Expression e1,
Expression e2)
Check if one expression matches another: e1 LIKE e2 |
|
static Restriction |
lt(Expression e1,
Expression e2)
Compare if one expression is less than another: new restriction = e1 < e2. |
|
static Restriction |
lteq(Expression e1,
Expression e2)
Compare if one expression is less than or equal to another: new restriction = e1 <= e2. |
|
static Restriction |
neq(Expression e1,
Expression e2)
Compare if two expressions are inequal: new restriction = e1 <> e2. |
|
static Restriction |
not(Restriction r)
Negate a restriction: new restriction = NOT r |
|
static Restriction |
notLike_in(Expression e1,
Expression... e2)
Check if one expression doesn't matches any of the expressions in an array. |
|
static Restriction |
nullSafeAnd(Restriction... r)
Combine one or more restrictions with AND ignoring null elements. |
|
static Restriction |
nullSafeOr(Restriction... r)
Combine one or more restrictions with OR ignoring null elements. |
|
static Restriction |
or(Restriction... r)
Combine one or more restrictions with OR: new restriction = r[0] OR r[1] ... |
|
static Restriction |
rlike(Expression e,
Expression regexp)
Check if an expression matches a regular expression. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Restrictions()
| Method Detail |
|---|
public static Restriction and(Restriction... r)
throws InvalidDataException
r - The restrictions to combine
InvalidDataException - If any of the elements is null or
the array doesn't contain at least one element
public static Restriction nullSafeAnd(Restriction... r)
throws InvalidDataException
r - The restrictions to combine
InvalidDataException
public static Restriction or(Restriction... r)
throws InvalidDataException
r - The restrictions to combine
InvalidDataException - If any of the elements is null or
the array doesn't contain at least one element
public static Restriction nullSafeOr(Restriction... r)
throws InvalidDataException
r - The restrictions to combine
InvalidDataException
public static Restriction not(Restriction r)
throws InvalidDataException
r - The restrictions to negate
InvalidDataException - If the restriction is null
public static Restriction eq(Expression e1,
Expression e2)
throws InvalidDataException
e1 - The left expressione2 - The right expression
InvalidDataException - If both expressions are null
public static Restriction neq(Expression e1,
Expression e2)
throws InvalidDataException
e1 - The left expressione2 - The right expression
InvalidDataException - If both expressions are null
public static Restriction gt(Expression e1,
Expression e2)
throws InvalidDataException
e1 - The left expressione2 - The right expression
InvalidDataException - If any of the expressions are null
public static Restriction gteq(Expression e1,
Expression e2)
throws InvalidDataException
e1 - The left expressione2 - The right expression
InvalidDataException - If any of the expressions are null
public static Restriction lt(Expression e1,
Expression e2)
throws InvalidDataException
e1 - The left expressione2 - The right expression
InvalidDataException - If any of the expressions are null
public static Restriction lteq(Expression e1,
Expression e2)
throws InvalidDataException
e1 - The left expressione2 - The right expression
InvalidDataException - If any of the expressions are null
public static Restriction between(Expression e,
Expression low,
Expression high)
throws InvalidDataException
e - The expression to check against the limitslow - The expression for the low limithigh - The expression for the high limit
InvalidDataException - If any of the expressions are null
public static Restriction betweenInclusive(Expression e,
Expression low,
Expression high)
throws InvalidDataException
e - The expression to check against the limitslow - The expression for the low limithigh - The expression for the high limit
InvalidDataException - If any of the expressions are null
public static Restriction in(Expression e1,
Expression... e2)
throws InvalidDataException
e1 - The expression to checke2 - The set of expression to check against
InvalidDataException - If the set is null or empty
public static Restriction like(Expression e1,
Expression e2)
throws InvalidDataException
e1 - The left expressione2 - The right expression
InvalidDataException - If any of the expressions are null
public static Restriction like_in(Expression e1,
Expression... e2)
e1 - The left expressione2 - The array with expression to match against, null values are allowed
and compared with IS NULL instead
InvalidDataException - If any of the expressions are null.
public static Restriction notLike_in(Expression e1,
Expression... e2)
e1 - The left expression. Null is not allowede2 - The array with expressions that shouldn't match, null values
are allows and compared with NOT IS NULL
InvalidDataException - If any of the required expressions are null.
public static Restriction rlike(Expression e,
Expression regexp)
e - The expression to matchregexp - The regular expression to test against
InvalidDataException - If any of the values are nullprivate static int getFirstNull(Object[] array)
private static int countNotNulls(Object[] array)
private static <T> T[] copyNotNulls(T[] source,
T[] dest)
|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||