cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using findByMultipleParameters in CE

Former Member
0 Kudos

Hi All,

I have a problem with findByMultipleParameters operation in CAF Core for Version CE 7.1, because the code for performing a finder with multiple filters is deprecated:

QueryFilter condOpen = QueryFilterFactory.createQueryFilter();

+ condAbre.setOperation(QueryFilter.OPERATION_BRACKET_OPEN);+

+ QueryFilter condAND = QueryFilterFactory.createQueryFilter();+

+ condAND.setOperation(QueryFilter.OPERATION_AND);+

+ QueryFilter condClose = QueryFilterFactory.createQueryFilter();+

+ condCierra.setOperation(QueryFilter.OPERATION_BRACKET_CLOSE);+

with findByMultipleParameters method we could implement a query with several filters that are not required, so you can "build" your query depending of the filters that the user choose.

But in Caf Core for CE version if you implement a custom finder choosing the fields you want to search by, It's behaivor is like using AND condition between the filters, so you MUST have all your filters mandatory or It doesn't work, if you try to implment a findByMultipleParameters method, It's marked as deprecated and It doesn't present any option.

Do you have any idea??

thanks a lot for your help!!!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

The solution given is really appropriate.

I am also working in CE7.1 .I have faced the same problem regarding "findByMultipleParameters" ,followed the same way as suggested and finally it worked.

But my another problem still persists.That is How to Use "OR " between two Query Filter condition,because if we add multiple queries into Query Filter List it will by default taking "AND " .

My another Query is what is the role of implCheck(Boolean),findByName(String) in "findByMultipleParameters" ?

Thanking you for your help in advance.

Regards,

Sonali

Former Member
0 Kudos

Hello Sergio,

I have implemented a project on caf and i use the search by multiple parameters, i´ll try help you write the code with that i wrote:


   List<QueryFilter> list = new ArrayList<QueryFilter>();
   list.add(QueryFilterFactory.createFilter("products.name", Condition.EQ, "Pen"));
   list.add(QueryFilterFactory.createFilter("products.code", Condition.EQ, 30));
   OrderBy orderBy = new OrderBy("products.name");
   Paging paging = new Paging(10);
   myService.findByMultipleParameters(lista, orderBy , paging, "");

It´s works fine, i use the NWDS 7.1 Sp01 too, and the code o find by multiple parameters doesn´t deprecated.

Regards

Ronaldo Rampelotti