diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java index b9f8c845c..5a7b18b62 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java @@ -28,7 +28,7 @@ public class ProjectDaoImpl extends DatabaseAccess implements ProjectDa public QueryableList getWithCriteria(ProjectCriteria criteria) { QueryableList query = getDatabaseService().getQueryable(Project.class); if (criteria.getLike() != null && !criteria.getLike().isEmpty()) - query.where((builder, root) -> + query.where((builder, root) -> builder.or(builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%"), builder.or(builder.like(builder.upper(root.get("description")), "%" + criteria.getLike().toUpperCase() + "%")))); if (criteria.getPeriodEnd() != null) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ResearcherDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ResearcherDaoImpl.java index 7faa9e8f6..086adf820 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ResearcherDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ResearcherDaoImpl.java @@ -22,11 +22,11 @@ public class ResearcherDaoImpl extends DatabaseAccess implements Res @Override public QueryableList getWithCriteria(ResearcherCriteria criteria) { - QueryableList query = this.getDatabaseService().getQueryable(Researcher.class); - if (criteria.getLike() != null) - query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike())); - if (criteria.getName() != null) - query.where((builder, root) -> builder.equal(root.get("label"), criteria.getName())); + QueryableList 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() + "%"))); + if (criteria.getName() != null && !criteria.getName().isEmpty()) + query.where((builder, root) ->builder.or(builder.like(builder.upper(root.get("label")), "%" + criteria.getName().toUpperCase() + "%"))); return query; } diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/ResearcherManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/ResearcherManager.java index 68d5fb91b..95066af1e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/ResearcherManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/ResearcherManager.java @@ -34,7 +34,8 @@ public class ResearcherManager { ResearchersExternalSourcesModel researchersExternalSourcesModel = new ResearchersExternalSourcesModel().fromExternalItem(remoteRepos); for (ExternalSourcesItemModel externalListingItem : researchersExternalSourcesModel) { eu.eudat.models.data.dmp.Researcher researcher = apiContext.getOperationsContext().getBuilderFactory().getBuilder(ResearcherBuilder.class) - .label(externalListingItem.getAbbreviation()).id(externalListingItem.getId()) + .label(externalListingItem.getAbbreviation()) + .id(externalListingItem.getId()) .name(externalListingItem.getName()) .build(); researchers.add(researcher);