package net.curisit.securis.db; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import org.codehaus.jackson.annotate.JsonAutoDetect; import org.codehaus.jackson.annotate.JsonIgnore; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; /** * Entity implementation class for Entity: pack_metadata * */ @JsonAutoDetect @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) @Entity @Table(name = "pack_metadata") @NamedQueries({ @NamedQuery(name = "list-pack-metadata", query = "SELECT a FROM PackMetadata a where a.pack.id = :packId") }) public class PackMetadata implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue private int id; private String key; private String value; private boolean readonly; @JsonIgnore @ManyToOne @JoinColumn(name = "pack_id") private Pack pack; public int getId() { return id; } public void setId(int id) { this.id = id; } @JsonProperty("pack_id") public Integer getPackId() { return pack == null ? null : pack.getId(); } @JsonProperty("pack_id") public void setLicenseTypeId(Integer idPack) { if (idPack == null) { pack = null; } else { pack = new Pack(); pack.setId(idPack); } } public Pack getPack() { return pack; } public void setPack(Pack pack) { this.pack = pack; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public boolean isReadonly() { return readonly; } public void setReadonly(boolean readonly) { this.readonly = readonly; } }