argos/dmp-backend/src/main/java/entities/DatasetProfileViewstyle.java

88 lines
2.1 KiB
Java
Raw Normal View History

package entities;
import java.io.Serializable;
import java.util.UUID;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import org.json.XML;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Entity
@Table(name="\"DatasetProfileViewstyle\"")
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
public class DatasetProfileViewstyle implements Serializable {
private static final long serialVersionUID = -3251295258160291468L;
public DatasetProfileViewstyle () {}
@Id
@GeneratedValue
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
private UUID id;
@OneToOne(fetch = FetchType.EAGER, mappedBy = "viewstyle", cascade = CascadeType.ALL)
private DatasetProfile datasetProfile;
@Column(name = "\"Label\"")
private String label;
@Type(type="typedefinition.XMLType")
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
private String definition;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getDefinition() {
// return XML.toJSONObject(definition).toString(); //return definition as json
return definition;
}
public void setDefinition(String definition) {
// this.definition = XML.toString(definition); //if definition is in json
this.definition = definition;
}
public DatasetProfile getDatasetProfile() {
return datasetProfile;
}
public void setDatasetProfile(DatasetProfile datasetProfile) {
this.datasetProfile = datasetProfile;
}
}