diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserInfoDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserInfoDaoImpl.java index 93fb0321d..960cca165 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserInfoDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserInfoDaoImpl.java @@ -38,8 +38,8 @@ public class UserInfoDaoImpl extends DatabaseAccess implements UserInf @Override public QueryableList getAuthenticated(QueryableList users, UUID principalId) { users.initSubQuery(UUID.class).where((builder, root) -> - builder.and(builder.equal(root.join("dmps").get("id"), - users.subQuery((builder1, root1) -> builder1.equal(root1.join("dmps").get("id"), principalId), + builder.and(root.join("dmps").get("id").in( + users.subQuery((builder1, root1) -> builder1.equal(root1.get("id"), principalId), Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmps:id")))), builder.notEqual(root.get("id"), principalId))); diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserInfo.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserInfo.java index cd45762a9..ec953c492 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserInfo.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserInfo.java @@ -14,7 +14,7 @@ import java.util.*; @NamedEntityGraphs({ @NamedEntityGraph( name = "userInfo", - attributeNodes = {@NamedAttributeNode("userRoles"), @NamedAttributeNode("credentials"),@NamedAttributeNode("dmps")}), + attributeNodes = {@NamedAttributeNode("userRoles"), @NamedAttributeNode("credentials")}), }) public class UserInfo implements DataEntity { diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/QueryableList.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/QueryableList.java index 4f8f05695..9c2c1191f 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/QueryableList.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/QueryableList.java @@ -55,7 +55,7 @@ public interface QueryableList { Subquery subQueryCount(SinglePredicate predicate, List fields); - QueryableList initSubQuery(Class uClass); + QueryableList initSubQuery(Class uClass); Subquery subQueryMax(SinglePredicate predicate, List fields, Class uClass); diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/hibernatequeryablelist/QueryableHibernateList.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/hibernatequeryablelist/QueryableHibernateList.java index eed0bba6b..66fc29922 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/hibernatequeryablelist/QueryableHibernateList.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/hibernatequeryablelist/QueryableHibernateList.java @@ -410,7 +410,7 @@ public class QueryableHibernateList implements QueryableLi return subquery; } - public QueryableList initSubQuery(Class uClass) { + public QueryableList initSubQuery(Class uClass) { this.subquery = this.manager.getCriteriaBuilder().createQuery().subquery(uClass); this.nestedQueryRoot = subquery.from(this.tClass); return this;