package eu.dnetlib.data.is.context.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;

import com.vladmihalcea.hibernate.type.json.JsonBinaryType;
import com.vladmihalcea.hibernate.type.json.JsonStringType;

@MappedSuperclass
@TypeDefs({
	@TypeDef(name = "json", typeClass = JsonStringType.class),
	@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
})
public abstract class CtxInfo implements Serializable {

	private static final long serialVersionUID = 4912082158208138795L;

	@Id
	@Column(name = "id")
	private String id;

	@Column(name = "label")
	private String label;

	@Type(type = "jsonb")
	@Column(name = "params")
	private Parameter[] parameters;

	@Transient
	private long nChilds = 0;

	public String getId() {
		return id;
	}

	public void setId(final String id) {
		this.id = id;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(final String label) {
		this.label = label;
	}

	public Parameter[] getParameters() {
		return parameters;
	}

	public void setParameters(final Parameter[] parameters) {
		this.parameters = parameters;
	}

	public long getnChilds() {
		return nChilds;
	}

	public void setnChilds(final long nChilds) {
		this.nChilds = nChilds;
	}

}
