From dd7007128b326d561b04a65c4556e05d977740fa Mon Sep 17 00:00:00 2001 From: amentis Date: Wed, 6 Dec 2023 16:12:30 +0200 Subject: [PATCH] small fix --- .../core/src/main/java/eu/eudat/query/TenantUserQuery.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dmp-backend/core/src/main/java/eu/eudat/query/TenantUserQuery.java b/dmp-backend/core/src/main/java/eu/eudat/query/TenantUserQuery.java index 44a52e600..a0884b075 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/query/TenantUserQuery.java +++ b/dmp-backend/core/src/main/java/eu/eudat/query/TenantUserQuery.java @@ -14,7 +14,6 @@ import gr.cite.tools.data.query.QueryBase; import gr.cite.tools.data.query.QueryContext; import jakarta.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.Predicate; -import jakarta.persistence.criteria.Subquery; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; @@ -168,9 +167,8 @@ public class TenantUserQuery extends QueryBase { predicates.add(inClause); } if (this.userQuery != null) { - Subquery subQuery = queryContext.Query.subquery(this.userQuery.entityClass()); - this.applySubQuery(this.userQuery, queryContext.CriteriaBuilder, subQuery); - predicates.add(queryContext.CriteriaBuilder.in(queryContext.Root.get(TenantUserEntity._userId)).value(subQuery)); + QueryContext subQuery = this.applySubQuery(this.userQuery, queryContext, UUID.class, root -> root.get(TenantUserEntity._userId)); + predicates.add(queryContext.CriteriaBuilder.in(queryContext.Root.get(TenantUserEntity._userId)).value(subQuery.Query)); } if (predicates.size() > 0) { Predicate[] predicatesArray = predicates.toArray(new Predicate[0]);