[New] added querySize() methods to ElementMap

This commit is contained in:
Robert von Burg 2014-01-15 22:09:53 +01:00
parent 5ac8d4f875
commit ace469227d
1 changed files with 18 additions and 0 deletions

View File

@ -49,6 +49,24 @@ public abstract class AbstractDao<T extends StrolchElement> implements StrolchDa
return typeRef;
}
@Override
public long querySize() {
long size = 0;
Set<String> types = queryTypes();
for (String type : types) {
SubTypeRef subTypeRef = this.tx.getObjectRefCache().getSubTypeRef(getClassType(), type);
size += this.tx.getMetadataDao().querySize(subTypeRef);
}
return size;
}
@Override
public long querySize(String type) {
SubTypeRef subTypeRef = this.tx.getObjectRefCache().getSubTypeRef(getClassType(), type);
return tx.getMetadataDao().querySize(subTypeRef);
}
@Override
public Set<String> queryKeySet() {
Set<String> keys = new HashSet<>();