From 20fc23c19c026bf7ff596b3e4f74c1d620b14a02 Mon Sep 17 00:00:00 2001
From: rob bygrave
+ *
*
+ *
*
* Example 1:
* {@code
*
@@ -327,7 +327,7 @@ public interface ExpressionList
- * Example 2:
* {@code
*
@@ -349,7 +349,6 @@ public interface ExpressionList{@code
*
* String name =
@@ -434,7 +433,6 @@ public interface ExpressionList
*
{@code
*
* PagedList pagedList = Ebean.find(Order.class)
@@ -573,7 +571,6 @@ public interface ExpressionList {
/**
* Extended version for setDistinct in conjunction with "findSingleAttributeList";
- *
*
{@code
*
* List> orderStatusCount =
@@ -683,7 +680,6 @@ public interface ExpressionList {
/**
* Equal to expression for the value at the given path in the JSON document.
- *
*
{@code
*
* where().jsonEqualTo("content", "path.other", 34)
@@ -698,7 +694,6 @@ public interface ExpressionList {
/**
* Not Equal to - for the given path in a JSON document.
- *
*
{@code
*
* where().jsonNotEqualTo("content", "path.other", 34)
@@ -713,7 +708,6 @@ public interface ExpressionList {
/**
* Greater than - for the given path in a JSON document.
- *
*
{@code
*
* where().jsonGreaterThan("content", "path.other", 34)
@@ -724,7 +718,6 @@ public interface ExpressionList {
/**
* Greater than or equal to - for the given path in a JSON document.
- *
*
{@code
*
* where().jsonGreaterOrEqual("content", "path.other", 34)
@@ -735,7 +728,6 @@ public interface ExpressionList {
/**
* Less than - for the given path in a JSON document.
- *
*
{@code
*
* where().jsonLessThan("content", "path.other", 34)
@@ -746,7 +738,6 @@ public interface ExpressionList {
/**
* Less than or equal to - for the given path in a JSON document.
- *
*
{@code
*
* where().jsonLessOrEqualTo("content", "path.other", 34)
@@ -757,7 +748,6 @@ public interface ExpressionList {
/**
* Between - for the given path in a JSON document.
- *
*
{@code
*
* where().jsonBetween("content", "orderDate", lowerDateTime, upperDateTime)
@@ -771,7 +761,6 @@ public interface ExpressionList {
*
* This returns the list so that add() can be chained.
*
- *
*
{@code
*
* Query query = Ebean.find(Customer.class);
@@ -868,7 +857,6 @@ public interface ExpressionList {
* To get control over the options you can create an ExampleExpression and set
* those options such as case insensitive etc.
*
- *
*
{@code
*
* // create an example bean and set the properties
@@ -877,7 +865,7 @@ public interface ExpressionList {
* example.setName("Rob%");
* example.setNotes("%something%");
*
- * List<Customer> list = Ebean.find(Customer.class).where()
+ * List list = Ebean.find(Customer.class).where()
* // pass the bean into the where() clause
* .exampleLike(example)
* // you can add other expressions to the same query
@@ -886,7 +874,7 @@ public interface ExpressionList {
* }
*
* Similarly you can create an ExampleExpression
- *
+ *
* {@code
*
* Customer example = new Customer();
@@ -1108,7 +1096,6 @@ public interface ExpressionList {
/**
* Add expression for ALL of the given bit flags to be set.
- *
*
{@code
*
* where().bitwiseAll("flags", BwFlags.HAS_BULK + BwFlags.HAS_COLOUR)
@@ -1122,7 +1109,6 @@ public interface ExpressionList {
/**
* Add expression for the given bit flags to be NOT set.
- *
*
{@code
*
* where().bitwiseNot("flags", BwFlags.HAS_COLOUR)
@@ -1173,6 +1159,13 @@ public interface ExpressionList {
* raw("add_days(orderDate, 10) < ?", someDate)
*
* }
+ *
+ * Subquery example:
+ * {@code
+ *
+ * .raw("t0.customer_id in (select customer_id from customer_group where group_id = any(?::uuid[]))", groupIds)
+ *
+ * }
*/
ExpressionList raw(String raw, Object value);
@@ -1197,12 +1190,18 @@ public interface ExpressionList {
* then they are not translated. logical property name names (not fully
* qualified) will still be translated to their physical name.
*
- *
*
{@code
*
* raw("orderQty < shipQty")
*
* }
+ *
+ * Subquery example:
+ * {@code
+ *
+ * .raw("t0.customer_id in (select customer_id from customer_group where group_id = any(?::uuid[]))", groupIds)
+ *
+ * }
*/
ExpressionList raw(String raw);
@@ -1276,12 +1275,10 @@ public interface ExpressionList {
* typically you only explicitly need to use the and() junction
* when it is nested inside an or() or not() junction.
*
- *
*
{@code
*
* // Example: Nested and()
*
- * Ebean.find(Customer.class)
* .where()
* .or()
* .and() // nested and
@@ -1302,16 +1299,27 @@ public interface ExpressionList {
* Return a list of expressions that will be joined by OR's.
* This is exactly the same as disjunction();
*
- *
* Use endOr() or endJunction() to end the OR junction.
*
- *
+ *
+ *
{@code
+ *
+ * // Example: (status active OR anniversary is null)
+ *
+ * .where()
+ * .or()
+ * .eq("status", Customer.Status.ACTIVE)
+ * .isNull("anniversary")
+ * .orderBy().asc("name")
+ * .findList();
+ *
+ * }
+ *
* {@code
*
* // Example: Use or() to join
* // two nested and() expressions
*
- * Ebean.find(Customer.class)
* .where()
* .or()
* .and()
@@ -1335,8 +1343,8 @@ public interface ExpressionList {
* Use endNot() or endJunction() to end expressions being added to the
* NOT expression list.
*
- *
- *
@{code
+ *
+ * {@code
*
* .where()
* .not()
@@ -1345,12 +1353,11 @@ public interface ExpressionList {
* .endNot()
*
* }
- *
- *
@{code
+ *
+ * {@code
*
* // Example: nested not()
*
- * Ebean.find(Customer.class)
* .where()
* .eq("status", Customer.Status.ACTIVE)
* .not()