@Override
public final Criteria<? extends IEntity> translateListingSearchCriteria(ListingContext context,
IListingSearch listingSearch) throws IllegalArgumentException {
if(listingSearch instanceof INamedQuerySearch) {
// named query search
final INamedQuerySearch nqs = (INamedQuerySearch) listingSearch;
final ISelectNamedQueryDef queryDef = context.getNamedQueryResolver().resolveNamedQuery(nqs.getQueryName());
if(queryDef == null) {
throw new IllegalArgumentException("Unable to resolve named query: " + nqs.getQueryName());
}
return translateNamedQuerySearch(queryDef, nqs.getQueryParams());
}
// non-named query search
return translateNonNamedQuery(context, listingSearch);
}