Showing results for 
Search instead for 
Did you mean: 

Is it possible List params in 'collectionType field IN' condition of Where clause of flexibleSearchQuery?

0 Kudos
  • EnumType

AccountClassificationEnum (AccountClassificationEnum.CONSUMER, AccountClassificationEnum.MEMBER, AccountClassificationEnum.ADMIN)

  • collectiontype of EnumType

AccountClassificationCollection. elementtype="AccountClassificationEnum"

  • Faq Item Type has allowedClassifications attribute.

FaqModel.allowedClassifications is AccountClassificationCollection (it's not relation type. old collectionType)

In this case, May I use List params in 'IN' condition of Where clause of flexibleSearchQuery?

List enumList = new ArrayList(); enumList.add(AccountClassificationEnum.CONSUMER); enumList.add(AccountClassificationEnum.MEMBER);

query.append("AND {q:").append(FaqModel.ALLOWEDCLASSIFICATIONS).append("} IN (?enumList)"); params.put("enumList", enumList)

. . .

result is empty.

Sorry for my broken English. Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

That's the problem with the collection types, they can not be used in the WHERE clause of a query, they are serialized as string into the database

As a workaround, you could try using LIKE %<classification-pk>%, but be aware of the performance penalty of LIKE, depending on your database

0 Kudos

Thank you a lot!

Answers (0)