Removed wrong Abstract annotation and fixed property names

This commit is contained in:
Luca Frosini 2021-10-21 16:01:38 +02:00
parent f2fbfc7b66
commit 42a650167b
2 changed files with 14 additions and 15 deletions

View File

@ -29,12 +29,12 @@ public class QueryTemplateImpl extends EntityElementImpl implements QueryTemplat
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
protected Map<Version, String> changelog; protected Map<Version, String> changelog;
protected TemplateProperty templateProperty; protected TemplateProperty template;
protected Map<String, TemplateVariable> templateDefaultValues; protected Map<String, TemplateVariable> templateVariables;
public QueryTemplateImpl() { public QueryTemplateImpl() {
this.changelog = new HashMap<>(); this.changelog = new HashMap<>();
this.templateDefaultValues = new HashMap<>(); this.templateVariables = new HashMap<>();
} }
@Override @Override
@ -120,23 +120,23 @@ public class QueryTemplateImpl extends EntityElementImpl implements QueryTemplat
@Override @Override
public TemplateProperty getTemplate() { public TemplateProperty getTemplate() {
return templateProperty; return template;
} }
@Override @Override
public void setTemplate(TemplateProperty templateProperty) { public void setTemplate(TemplateProperty template) {
this.templateProperty = templateProperty; this.template = template;
} }
@Override @Override
public Map<String, TemplateVariable> getTemplateVariables() { public Map<String, TemplateVariable> getTemplateVariables() {
return templateDefaultValues; return templateVariables;
} }
@Override @Override
public void addTemplateVariable(TemplateVariable templateVariable) { public void addTemplateVariable(TemplateVariable templateVariable) {
String name = templateVariable.getName(); String name = templateVariable.getName();
this.templateDefaultValues.put(name, templateVariable); this.templateVariables.put(name, templateVariable);
} }
} }

View File

@ -13,7 +13,6 @@ import org.gcube.informationsystem.base.reference.entities.EntityElement;
import org.gcube.informationsystem.querytemplates.impl.entities.QueryTemplateImpl; import org.gcube.informationsystem.querytemplates.impl.entities.QueryTemplateImpl;
import org.gcube.informationsystem.querytemplates.reference.properties.TemplateProperty; import org.gcube.informationsystem.querytemplates.reference.properties.TemplateProperty;
import org.gcube.informationsystem.querytemplates.reference.properties.TemplateVariable; import org.gcube.informationsystem.querytemplates.reference.properties.TemplateVariable;
import org.gcube.informationsystem.types.annotations.Abstract;
import org.gcube.informationsystem.types.annotations.ISProperty; import org.gcube.informationsystem.types.annotations.ISProperty;
import org.gcube.informationsystem.types.reference.Change; import org.gcube.informationsystem.types.reference.Change;
import org.gcube.informationsystem.types.reference.TypeMetadata; import org.gcube.informationsystem.types.reference.TypeMetadata;
@ -22,7 +21,6 @@ import org.gcube.informationsystem.utils.Version;
/** /**
* @author Luca Frosini (ISTI - CNR) * @author Luca Frosini (ISTI - CNR)
*/ */
@Abstract
@JsonIgnoreProperties(ignoreUnknown=true) @JsonIgnoreProperties(ignoreUnknown=true)
@JsonDeserialize(as=QueryTemplateImpl.class) @JsonDeserialize(as=QueryTemplateImpl.class)
@TypeMetadata(name = QueryTemplate.NAME, description = "The type used to store Query Templates", version = Version.MINIMAL_VERSION_STRING) @TypeMetadata(name = QueryTemplate.NAME, description = "The type used to store Query Templates", version = Version.MINIMAL_VERSION_STRING)
@ -36,8 +34,8 @@ public interface QueryTemplate extends EntityElement {
public static final String VERSION_PROPERTY = "version"; public static final String VERSION_PROPERTY = "version";
public static final String CHANGELOG_PROPERTY = "changelog"; public static final String CHANGELOG_PROPERTY = "changelog";
public static final String QUERY_TEMPLATE_PROPERTY = "queryTemplate"; public static final String TEMPLATE_PROPERTY = "template";
public static final String QUERY_TEMPLATE_DEFAULT_VALUES_PROPERTY = "queryTemplateDefaultValues"; public static final String TEMPLATE_VARIABLES_PROPERTY = "templateVariables";
@ISProperty(name = NAME_PROPERTY, description = "The name of the Query Template. Among UUID univocally identifiy the Query Template.", readonly = true, mandatory = true, nullable = false) @ISProperty(name = NAME_PROPERTY, description = "The name of the Query Template. Among UUID univocally identifiy the Query Template.", readonly = true, mandatory = true, nullable = false)
public String getName(); public String getName();
@ -82,14 +80,15 @@ public interface QueryTemplate extends EntityElement {
@JsonIgnore @JsonIgnore
public void addChangelog(String version, String changeDescription); public void addChangelog(String version, String changeDescription);
@JsonGetter(value = QUERY_TEMPLATE_PROPERTY) @JsonGetter(value = TEMPLATE_PROPERTY)
@ISProperty(name = QUERY_TEMPLATE_PROPERTY, description = "The Query Template. It can contains QueryVariable to be replaced to obtain a runnable query.", readonly = false, mandatory = true, nullable = false) @ISProperty(name = TEMPLATE_PROPERTY, description = "The Query Template. It can contains query variables to be replaced to obtain a runnable query.", readonly = false, mandatory = true, nullable = false)
public TemplateProperty getTemplate(); public TemplateProperty getTemplate();
@JsonIgnore @JsonIgnore
public void setTemplate(TemplateProperty templateProperty); public void setTemplate(TemplateProperty templateProperty);
@JsonGetter(value = QUERY_TEMPLATE_DEFAULT_VALUES_PROPERTY) @JsonGetter(value = TEMPLATE_VARIABLES_PROPERTY)
@ISProperty(name = TEMPLATE_VARIABLES_PROPERTY, description = "The Query Template Variables. It can contains Query Template Variable to be replaced to obtain a runnable query.", readonly = false, mandatory = true, nullable = false)
public Map<String, TemplateVariable> getTemplateVariables(); public Map<String, TemplateVariable> getTemplateVariables();
@JsonIgnore @JsonIgnore