Fix on entity doi query

This commit is contained in:
Thomas Georgios Giannos 2023-12-06 18:08:15 +02:00
parent 8227f60cda
commit b9eba9edcb
1 changed files with 6 additions and 6 deletions

View File

@ -186,17 +186,17 @@ public class EntityDoiQuery extends QueryBase<EntityDoiEntity> {
predicates.add(notInClause.not());
}
if (this.dois != null) {
CriteriaBuilder.In<String> notInClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(EntityDoiEntity._doi));
CriteriaBuilder.In<String> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(EntityDoiEntity._doi));
for (String item : this.dois)
notInClause.value(item);
predicates.add(notInClause.not());
inClause.value(item);
predicates.add(inClause);
}
if (this.entityIds != null) {
CriteriaBuilder.In<UUID> noInClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(EntityDoiEntity._entityId));
CriteriaBuilder.In<UUID> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(EntityDoiEntity._entityId));
for (UUID item: this.entityIds) {
noInClause.value(item);
predicates.add(noInClause.not());
inClause.value(item);
predicates.add(inClause);
}
}
if (!predicates.isEmpty()) {