Skip to content
Snippets Groups Projects
Commit b98b4a98 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

FIX: remove internal IDs from resultset also if not FIND query

parent 56e857f6
No related branches found
No related tags found
1 merge request!65F permission checks
Pipeline #26382 failed
...@@ -719,10 +719,7 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac ...@@ -719,10 +719,7 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
private void fillContainerWithResult() { private void fillContainerWithResult() {
if (this.container != null && this.type == Type.FIND) { if (this.container != null && this.type == Type.FIND) {
for (final IdVersionAclTriplet t : this.resultSet) { for (final IdVersionAclTriplet t : this.resultSet) {
// ignore internal entities
if (t.id < 100) {
continue;
}
final Entity e = new RetrieveEntity(t.id, t.version); final Entity e = new RetrieveEntity(t.id, t.version);
// if query has select-clause: // if query has select-clause:
...@@ -761,6 +758,7 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac ...@@ -761,6 +758,7 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
} }
this.resultSet = filterEntitiesWithoutRetrievePermission(this.resultSet); this.resultSet = filterEntitiesWithoutRetrievePermission(this.resultSet);
removeInternalEntitiesFromResultSet();
fillContainerWithResult(); fillContainerWithResult();
} catch (final SQLException e) { } catch (final SQLException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -774,6 +772,16 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac ...@@ -774,6 +772,16 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
cache.clear(); cache.clear();
} }
/** There are internal Entities (with ID<100) that should never be returned * */
private void removeInternalEntitiesFromResultSet() {
for (final IdVersionAclTriplet t : resultSet) {
// ignore internal entities
if (t.id < 100) {
resultSet.remove(t);
}
}
}
/** /**
* Cache a query result. * Cache a query result.
* *
...@@ -919,9 +927,6 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac ...@@ -919,9 +927,6 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
final long t1 = System.currentTimeMillis(); final long t1 = System.currentTimeMillis();
final IdVersionAclTriplet triplet = entityIterator.next(); final IdVersionAclTriplet triplet = entityIterator.next();
if (triplet.id <= 99) {
continue;
}
if (!acl_cache.containsKey(triplet.acl)) { if (!acl_cache.containsKey(triplet.acl)) {
acl_cache.put( acl_cache.put(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment