mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#605 - Add and() and or() ... as synonyms for conjunction() and disjunction() ... to the "Query Criteria API"
This commit is contained in:
@@ -888,6 +888,18 @@ public interface ExpressionList<T> {
|
||||
*/
|
||||
ExpressionList<T> not(Expression exp);
|
||||
|
||||
/**
|
||||
* Return a list of expressions that will be joined by AND's.
|
||||
* This is exactly the same as conjunction();
|
||||
*/
|
||||
Junction<T> and();
|
||||
|
||||
/**
|
||||
* Return a list of expressions that will be joined by OR's.
|
||||
* This is exactly the same as disjunction();
|
||||
*/
|
||||
Junction<T> or();
|
||||
|
||||
/**
|
||||
* Return a list of expressions that will be joined by AND's.
|
||||
*/
|
||||
|
||||
@@ -652,6 +652,16 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
return junction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Junction<T> and() {
|
||||
return conjunction();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Junction<T> or() {
|
||||
return disjunction();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Junction<T> conjunction() {
|
||||
Junction<T> conjunction = expr.conjunction(query, this);
|
||||
|
||||
@@ -320,6 +320,16 @@ abstract class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, E
|
||||
return exprList.betweenProperties(lowProperty, highProperty, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Junction<T> and() {
|
||||
return conjunction();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Junction<T> or() {
|
||||
return disjunction();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Junction<T> conjunction() {
|
||||
return exprList.conjunction();
|
||||
|
||||
Reference in New Issue
Block a user