diff --git a/src/main/java/org/caosdb/server/query/Backreference.java b/src/main/java/org/caosdb/server/query/Backreference.java index fec64b19b761418a4da148ca4adff9d9145960af..7d551fd45e761a54d2c2508dcbb1b98ffc72891c 100644 --- a/src/main/java/org/caosdb/server/query/Backreference.java +++ b/src/main/java/org/caosdb/server/query/Backreference.java @@ -130,7 +130,7 @@ public class Backreference implements EntityFilterInterface, QueryInterface { callApplyBackRef.setNull(2, VARCHAR); } if (this.propertiesTable != null) { // propertiesTable - getQuery().filterEntitiesWithoutRetrievePermission(this.propertiesTable); + getQuery().filterIntermediateResult(this.propertiesTable); callApplyBackRef.setString(3, this.propertiesTable); this.statistics.put("propertiesTable", this.propertiesTable); this.statistics.put( @@ -140,7 +140,7 @@ public class Backreference implements EntityFilterInterface, QueryInterface { callApplyBackRef.setNull(3, VARCHAR); } if (this.entitiesTable != null) { // entitiesTable - getQuery().filterEntitiesWithoutRetrievePermission(this.entitiesTable); + getQuery().filterIntermediateResult(this.entitiesTable); callApplyBackRef.setString(4, this.entitiesTable); this.statistics.put("entitiesTable", this.entitiesTable); this.statistics.put( diff --git a/src/main/java/org/caosdb/server/query/Query.java b/src/main/java/org/caosdb/server/query/Query.java index 24be240bf579b0cb8689280446b771271109f5cd..80274dc7448e954d36cc131a980fd4c51535bc9a 100644 --- a/src/main/java/org/caosdb/server/query/Query.java +++ b/src/main/java/org/caosdb/server/query/Query.java @@ -855,12 +855,12 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac /** * Filter out all entities which may not be retrieved by this user due to a missing RETRIEVE - * permission. This one is also designed for filtering of intermediate results. + * permission. This function is also designed for filtering of intermediate results. * * @param tabname * @throws SQLException */ - public void filterEntitiesWithoutRetrievePermission(final String tabname) throws SQLException { + public void filterIntermediateResult(final String tabname) throws SQLException { if (!filterEntitiesWithoutRetrievePermisions) { return; } @@ -897,10 +897,10 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac } /** - * Creates a new list that contains only the entities from the @resultSet for which the current + * Creates a new list that contains only the entities from the `resultSet` for which the current * subject has RETRIEVE permission. * - * <p>Note, unlike the public version of this function @resultSet is not altered but the filtered + * <p>Note, unlike the public version of this function `resultSet` is not altered but the filtered * list is returned. * * @param resultSet @@ -914,7 +914,6 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac if (-1 == toBeDeleted.indexOf(triplet.id)) { filtered.add(triplet); } - ; } return filtered; } diff --git a/src/main/java/org/caosdb/server/query/SubProperty.java b/src/main/java/org/caosdb/server/query/SubProperty.java index f3be825ccf28b7df2ba646306a61f006664ae5a6..8ff167eac1e045875576a75f3d922f5c6461c68e 100644 --- a/src/main/java/org/caosdb/server/query/SubProperty.java +++ b/src/main/java/org/caosdb/server/query/SubProperty.java @@ -87,7 +87,7 @@ public class SubProperty implements QueryInterface, EntityFilterInterface { this.filter.apply(this); - getQuery().filterEntitiesWithoutRetrievePermission(this.sourceSet); + getQuery().filterIntermediateResult(this.sourceSet); final CallableStatement callFinishSubProperty = getConnection().prepareCall("call finishSubProperty(?,?,?,?)"); diff --git a/src/test/java/org/caosdb/server/query/QueryTest.java b/src/test/java/org/caosdb/server/query/QueryTest.java index 1755023f434c5bfa63f0e47ba80116c2c7119e47..da1df301beb48874ca62a86264318ce3cd39a054 100644 --- a/src/test/java/org/caosdb/server/query/QueryTest.java +++ b/src/test/java/org/caosdb/server/query/QueryTest.java @@ -51,9 +51,9 @@ public class QueryTest { } String getCacheKeyWithUser(String query) { - Subject anonymous = SecurityUtils.getSubject(); - CaosDBServer.setProperty(ServerProperties.KEY_AUTH_OPTIONAL, "true"); - anonymous.login(AnonymousAuthenticationToken.getInstance()); + Subject anonymous = SecurityUtils.getSubject(); + CaosDBServer.setProperty(ServerProperties.KEY_AUTH_OPTIONAL, "true"); + anonymous.login(AnonymousAuthenticationToken.getInstance()); Query q = new Query(query, anonymous); q.parse(); return q.getCacheKey(true); @@ -87,7 +87,9 @@ public class QueryTest { "ename@(ref1,null)SUB(POV(pname,>,val1)", getCacheKey("FIND ename WHICH IS REFERENCED BY ref1 WITH pname > val1 ")); - assertEquals("anonymous@anonymous@enamePOV(pname,=,val1)", getCacheKeyWithUser("FIND ename WITH pname = val1")); + assertEquals( + "anonymous@anonymous@enamePOV(pname,=,val1)", + getCacheKeyWithUser("FIND ename WITH pname = val1")); } @Test