Fix query For Reasearcher dao Impl

This commit is contained in:
Diamantis Tziotzios 2019-02-13 15:46:17 +02:00
parent c9c4de0dc9
commit 44dcc77bec
1 changed files with 2 additions and 2 deletions

View File

@ -24,9 +24,9 @@ public class ResearcherDaoImpl extends DatabaseAccess<Researcher> implements Res
public QueryableList<Researcher> getWithCriteria(ResearcherCriteria criteria) {
QueryableList<Researcher> query = asQueryable();
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
query.where((builder, root) ->builder.or(builder.like(builder.upper(root.get("reference")), "%" + criteria.getLike().toUpperCase() + "%")));
query.where((builder, root) ->builder.or(builder.like(root.get("reference"), "%" + criteria.getLike().toUpperCase() + "%")));
if (criteria.getName() != null && !criteria.getName().isEmpty())
query.where((builder, root) ->builder.or(builder.like(builder.upper(root.get("label")), "%" + criteria.getName().toUpperCase() + "%")));
query.where((builder, root) ->builder.or(builder.like(root.get("label"), "%" + criteria.getName().toUpperCase() + "%")));
return query;
}