Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
4e80c5cd5d
|
@ -208,14 +208,14 @@ public class ReferenceQuery extends QueryBase<ReferenceEntity> {
|
||||||
predicates.add(queryContext.CriteriaBuilder.or(
|
predicates.add(queryContext.CriteriaBuilder.or(
|
||||||
queryContext.CriteriaBuilder.isNull(queryContext.Root.get(ReferenceEntity._createdById)),
|
queryContext.CriteriaBuilder.isNull(queryContext.Root.get(ReferenceEntity._createdById)),
|
||||||
userId != null ? queryContext.CriteriaBuilder.equal(queryContext.Root.get(ReferenceEntity._createdById), userId) : queryContext.CriteriaBuilder.or(), //Creates a false query
|
userId != null ? queryContext.CriteriaBuilder.equal(queryContext.Root.get(ReferenceEntity._createdById), userId) : queryContext.CriteriaBuilder.or(), //Creates a false query
|
||||||
userId != null ? queryContext.CriteriaBuilder.in(queryContext.Root.get(ReferenceEntity._id)).value(queryUtilsService.buildSubQuery(new BuildSubQueryInput<>(new BuildSubQueryInput.Builder<>(DmpReferenceEntity.class, UUID.class)
|
queryContext.CriteriaBuilder.in(queryContext.Root.get(ReferenceEntity._id)).value(queryUtilsService.buildSubQuery(new BuildSubQueryInput<>(new BuildSubQueryInput.Builder<>(DmpReferenceEntity.class, UUID.class)
|
||||||
.query(queryContext.Query)
|
.query(queryContext.Query)
|
||||||
.criteriaBuilder(queryContext.CriteriaBuilder)
|
.criteriaBuilder(queryContext.CriteriaBuilder)
|
||||||
.keyPathFunc((subQueryRoot) -> subQueryRoot.get(DmpReferenceEntity._referenceId))
|
.keyPathFunc((subQueryRoot) -> subQueryRoot.get(DmpReferenceEntity._referenceId))
|
||||||
.filterFunc((subQueryRoot, cb) ->
|
.filterFunc((subQueryRoot, cb) ->
|
||||||
cb.in(subQueryRoot.get(DmpReferenceEntity._dmpId)).value(queryUtilsService.buildDmpAuthZSubQuery(queryContext.Query, queryContext.CriteriaBuilder, userId, usePublic))
|
cb.in(subQueryRoot.get(DmpReferenceEntity._dmpId)).value(queryUtilsService.buildDmpAuthZSubQuery(queryContext.Query, queryContext.CriteriaBuilder, userId, usePublic))
|
||||||
)
|
)
|
||||||
))) : queryContext.CriteriaBuilder.or() //Creates a false query
|
))) //Creates a false query
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
if (!predicates.isEmpty()) {
|
if (!predicates.isEmpty()) {
|
||||||
|
|
Loading…
Reference in New Issue