mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-22 15:10:02 +00:00
#2069 - Add ebean-querybean, querybean-generator and kotlin-querybean-generator as modules
This commit is contained in:
1 parent
bc055fea25
commit
038db79737
140 files changed
+11583
No files matched your search
@@ -0,0 +1,37 @@
|
||||
package org.querytest;
|
||||
|
||||
import org.example.domain.Customer;
|
||||
import org.example.domain.query.QCustomer;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class QCustomerSimpleLikeQueryTest {
|
||||
|
||||
@Test
|
||||
public void testQuery() {
|
||||
|
||||
List<Customer> customers =
|
||||
new QCustomer()
|
||||
.name.ilike("rob")
|
||||
.status.equalTo(Customer.Status.GOOD)
|
||||
.registered.after(new Date())
|
||||
.contacts.email.endsWith("@foo.com")
|
||||
.orderBy()
|
||||
.name.asc()
|
||||
.registered.desc()
|
||||
.findList();
|
||||
|
||||
//where lower(t0.name) like ? and t0.status = ? and t0.registered > ? and u1.email like ? order by t0.name, t0.registered desc; --bind(rob,GOOD,Mon Jul 27 12:05:37 NZST 2015,%@foo.com)
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindEach() {
|
||||
|
||||
new QCustomer()
|
||||
.status.equalTo(Customer.Status.GOOD)
|
||||
.orderBy().id.asc()
|
||||
.findEach(customer -> System.out.println("-- visit " + customer));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user