Enhancement 91 : ENHANCEMENT: Query By Example ... type expression
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
1.1.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
19/03/2009
Updated 
19/03/2009
Type 
Enhancement
 
Attachments 
No attachments

Jacob Champlin supplied the request for ... and code to support query by example.

MinCustomer example = new MinCustomer();
example.setName("Rob%");
example.setNotes("%something%");
       
List<MinCustomer> list = Ebean.find(MinCustomer.class)
  .where()
    .exampleLike(example)
    .gt("id", 2)
    .findList();
 
Rob 19 Mar 07:56
And produces...
select c.id, c.name, c.notes
from o_customer c
where (c.name like ?  and c.notes like ? )  and c.id > ?

woResponse

Upload a file