Define a default OrderCriteria with a filed who is not defined as Sorter throw an error:
java com.avisto.jpasearch.exception.FieldNotInCriteriaException: Field lastname is not specified in criteria
example :
public enum ExampleCriteria implements ISearchCriteriaConfig<Example> {
LASTNAME(FilterConfig.of("lastname", StringFilterOperation.CONTAIN_IGNORE_CASE, "lastname"));
final ISearchConfig<RegionalDirector> searchConfig;
@Override
public OrderCriteria getDefaultOrderCriteria() {
return new OrderCriteria(LASTNAME.getKey(), SortDirection.DESC);
}
@Override
public Class<Example> getRootClass() {
return Example.class;
}
}
The error message is not explicit because the field exists but he has not defined as a sorter.
Proposition for a more explicit message :
Field lastname is not a Sorter
Define a default OrderCriteria with a filed who is not defined as Sorter throw an error:
java com.avisto.jpasearch.exception.FieldNotInCriteriaException: Field lastname is not specified in criteriaexample :
The error message is not explicit because the field exists but he has not defined as a sorter.
Proposition for a more explicit message :
Field lastname is not a Sorter