addFilterLike not work

49 views
Skip to first unread message

scz...@gmail.com

unread,
Jan 25, 2016, 10:02:45 PM1/25/16
to java-generic-dao

I used addFilterLike to query as below, but there is no result, it seems work same as 
   addFilterEqual. anybody have ever used it and please give me a example, thanks a lot.

Search search = new Search();

search.addFilterLike("name", "jac") // to query name include "jac", like jack.


tonis....@gmail.com

unread,
Jan 26, 2016, 2:27:56 PM1/26/16
to java-generic-dao
Try adding % to the start and/or the end of the query string depending on which way you want to match:

Search search = new Search().addFilterLike("name", "%jac%");

scz...@gmail.com

unread,
Jan 27, 2016, 10:09:03 AM1/27/16
to java-generic-dao, tonis....@gmail.com
Thanks tonis, it worked.
I used it as new Search().addFilterLike("name", "%"+name+"%");

在 2016年1月27日星期三 UTC+8上午3:27:56,tonis....@gmail.com写道:
Reply all
Reply to author
Forward
0 new messages