Fixes bug on Researchers autocomplete with case sensitivity.
This commit is contained in:
parent
7380c55443
commit
f6f28d6058
|
@ -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(root.get("reference"), "%" + criteria.getLike().toUpperCase() + "%")));
|
||||
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(root.get("label"), "%" + criteria.getName().toUpperCase() + "%")));
|
||||
query.where((builder, root) ->builder.or(builder.like(builder.upper(root.get("label")), "%" + criteria.getName().toUpperCase() + "%")));
|
||||
return query;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 2/5/2018.
|
||||
|
@ -40,7 +41,6 @@ public class ResearcherManager {
|
|||
.build();
|
||||
researchers.add(researcher);
|
||||
}
|
||||
researchers.stream().distinct();
|
||||
return researchers;
|
||||
return researchers.stream().distinct().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ export class ExternalSourcesService {
|
|||
}
|
||||
|
||||
public searchDMPResearchers(requestItem: RequestItem<ResearcherCriteria>): Observable<ExternalSourceItemModel[]> {
|
||||
return this.http.post<ExternalSourceItemModel[]>(environment.Server + '/researchers/getWithExternal', requestItem, { headers: this.headers });
|
||||
return this.http.post<ExternalSourceItemModel[]>(environment.Server + 'researchers/getWithExternal', requestItem, { headers: this.headers });
|
||||
}
|
||||
|
||||
public searchDMPOrganizations(like: string): Observable<ExternalSourceItemModel[]> {
|
||||
|
|
Loading…
Reference in New Issue