Solving querable keys issue

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@131482 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-09-19 10:53:57 +00:00
parent 0c6e05c122
commit 5a92c474db
2 changed files with 23 additions and 0 deletions

View File

@ -5,6 +5,7 @@ package org.gcube.accounting.datamodel;
import java.io.Serializable;
import java.util.Map;
import java.util.SortedSet;
import org.gcube.accounting.datamodel.backwardcompatibility.MoveToRecordType;
import org.gcube.accounting.datamodel.validations.annotations.ValidOperationResult;
@ -88,6 +89,16 @@ public abstract class BasicUsageRecord extends AbstractRecord implements UsageRe
public BasicUsageRecord(Map<String, ? extends Serializable> properties) throws InvalidValueException {
super(properties);
}
@Override
public SortedSet<String> getQuerableKeys()
throws Exception {
SortedSet<String> properties = super.getQuerableKeys();
properties.remove(UsageRecord.SCOPE);
return properties;
}
/**
* {@inheritDoc}

View File

@ -6,6 +6,7 @@ package org.gcube.accounting.datamodel.basetypes;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Map;
import java.util.SortedSet;
import org.gcube.accounting.datamodel.BasicUsageRecord;
import org.gcube.documentstore.exception.InvalidValueException;
@ -60,6 +61,17 @@ public abstract class AbstractJobUsageRecord extends BasicUsageRecord {
return AbstractJobUsageRecord.class.getSimpleName().replace(ABSTRACT_TO_REPLACE, "");
}
@Override
public SortedSet<String> getQuerableKeys()
throws Exception {
SortedSet<String> properties = super.getQuerableKeys();
properties.remove(JOB_START_TIME);
properties.remove(JOB_END_TIME);
return properties;
}
/**
* @return the Job Id
*/