mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
37 lines
1.0 KiB
HTML
37 lines
1.0 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
|
|
<TITLE>Collection objects for lazy loading</TITLE>
|
|
</HEAD>
|
|
<Body BGCOLOR="#ffffff">
|
|
Expressions for building WHERE clauses.
|
|
|
|
<p>
|
|
You will most likely use expressions directly off the ExpressionList.
|
|
</p>
|
|
<pre class="code">
|
|
Query<Order> query = Ebean.createQuery(Order.class)
|
|
.where()
|
|
.like("customer.name","rob%")
|
|
.gt("orderDate",lastWeek);
|
|
|
|
List<Order> orderList = query.findList();
|
|
...
|
|
</pre>
|
|
<p>
|
|
In the code above the LIKE and GREATER THAN Expressions are added to the where clause.
|
|
The way this works is that where() returns an ExpressionList which has methods on
|
|
it to create the standard expressions (EQUAL TO, LIKE etc).
|
|
</p>
|
|
<p>
|
|
I expect most people to add their expressions in this way. The Expr expression factory
|
|
object also has the ability to create the standard expressions.
|
|
</p>
|
|
<p>
|
|
You can build your own Expression objects by implementing the Expression interface.
|
|
</p>
|
|
|
|
|
|
</Body>
|
|
</HTML>
|