From 953cae6ce8872073493e69c34ff64492a8c51835 Mon Sep 17 00:00:00 2001
From: Robin Bygrave
- * Query<Customer> query = Ebean.createQuery(Customer.class);
+ * {@code
+ *
+ * Query query = Ebean.find(Customer.class);
* query.where()
- * .like("name","Rob%")
- * .eq("status", Customer.ACTIVE);
- * List<Customer> list = query.findList();
+ * .like("name","Rob%")
+ * .eq("status", Customer.ACTIVE);
+ *
+ * List list = query.findList();
* ...
- *
+ *
+ * }
*/
ExpressionList
+ * {@code
+ *
* // create an example bean and set the properties
* // with the query parameters you want
* Customer example = new Customer();
- * example.setName("Rob%");
- * example.setNotes("%something%");
+ * example.setName("Rob%");
+ * example.setNotes("%something%");
*
* List<Customer> list = Ebean.find(Customer.class).where()
* // pass the bean into the where() clause
* .exampleLike(example)
* // you can add other expressions to the same query
- * .gt("id", 2).findList();
+ * .gt("id", 2).findList();
*
- *
+ * }
*
* Similarly you can create an ExampleExpression
*
- * + **/ ExpressionList{@code + * * Customer example = new Customer(); - * example.setName("Rob%"); - * example.setNotes("%something%"); + * example.setName("Rob%"); + * example.setNotes("%something%"); * * // create a ExampleExpression with more control * ExampleExpression qbe = new ExampleExpression(example, true, LikeType.EQUAL_TO).includeZeros(); * - * List<Customer> list = Ebean.find(Customer.class).where().add(qbe).findList(); - *+ * Listlist = Ebean.find(Customer.class).where().add(qbe).findList(); + * + * }
{@code
+ *
+ * // use a database function
+ * raw("add_days(orderDate, 10) < ?", someDate)
+ *
+ * }
*/
ExpressionList{@code
+ *
+ * raw("orderQty < shipQty")
+ *
+ * }
*/
ExpressionList