| .. | .. |
|---|
| 2 | 2 | |
|---|
| 3 | 3 | import java.io.Serializable; |
|---|
| 4 | 4 | import java.util.Date; |
|---|
| 5 | | -import java.util.Set; |
|---|
| 6 | 5 | |
|---|
| 7 | 6 | import javax.persistence.Column; |
|---|
| 8 | 7 | import javax.persistence.Entity; |
|---|
| 9 | | -import javax.persistence.FetchType; |
|---|
| 10 | 8 | import javax.persistence.GeneratedValue; |
|---|
| 11 | 9 | import javax.persistence.Id; |
|---|
| 12 | 10 | import javax.persistence.JoinColumn; |
|---|
| 13 | 11 | import javax.persistence.ManyToOne; |
|---|
| 14 | 12 | import javax.persistence.NamedQueries; |
|---|
| 15 | 13 | import javax.persistence.NamedQuery; |
|---|
| 16 | | -import javax.persistence.OneToMany; |
|---|
| 17 | 14 | import javax.persistence.Table; |
|---|
| 18 | | - |
|---|
| 19 | | -import net.curisit.securis.beans.MetadataType; |
|---|
| 20 | 15 | |
|---|
| 21 | 16 | import org.codehaus.jackson.annotate.JsonAutoDetect; |
|---|
| 22 | 17 | import org.codehaus.jackson.annotate.JsonIgnore; |
|---|
| .. | .. |
|---|
| 38 | 33 | |
|---|
| 39 | 34 | private static final long serialVersionUID = 1L; |
|---|
| 40 | 35 | |
|---|
| 41 | | - @Id |
|---|
| 42 | | - @GeneratedValue |
|---|
| 43 | | - private int id; |
|---|
| 44 | | - |
|---|
| 45 | | - private String key; |
|---|
| 46 | | - |
|---|
| 47 | | - private String description; |
|---|
| 48 | | - |
|---|
| 49 | | - private MetadataType dataType; |
|---|
| 50 | | - |
|---|
| 51 | 36 | @JsonIgnore |
|---|
| 37 | + @Id |
|---|
| 52 | 38 | @ManyToOne |
|---|
| 53 | 39 | @JoinColumn(name = "application_id") |
|---|
| 54 | 40 | private Application application; |
|---|
| 55 | 41 | |
|---|
| 42 | + @Id |
|---|
| 43 | + private String key; |
|---|
| 44 | + |
|---|
| 45 | + private String value; |
|---|
| 46 | + |
|---|
| 47 | + private boolean mandatory; |
|---|
| 48 | + |
|---|
| 56 | 49 | @Column(name = "creation_timestamp") |
|---|
| 57 | 50 | private Date creationTimestamp; |
|---|
| 58 | 51 | |
|---|
| 59 | | - public int getId() { |
|---|
| 60 | | - return id; |
|---|
| 61 | | - } |
|---|
| 62 | | - |
|---|
| 63 | | - public void setId(int id) { |
|---|
| 64 | | - this.id = id; |
|---|
| 65 | | - } |
|---|
| 66 | 52 | |
|---|
| 67 | 53 | public String getKey() { |
|---|
| 68 | 54 | return key; |
|---|
| .. | .. |
|---|
| 70 | 56 | |
|---|
| 71 | 57 | public void setKey(String key) { |
|---|
| 72 | 58 | this.key = key; |
|---|
| 73 | | - } |
|---|
| 74 | | - |
|---|
| 75 | | - public String getDescription() { |
|---|
| 76 | | - return description; |
|---|
| 77 | | - } |
|---|
| 78 | | - |
|---|
| 79 | | - public void setDescription(String description) { |
|---|
| 80 | | - this.description = description; |
|---|
| 81 | | - } |
|---|
| 82 | | - |
|---|
| 83 | | - public MetadataType getDataType() { |
|---|
| 84 | | - return dataType; |
|---|
| 85 | | - } |
|---|
| 86 | | - |
|---|
| 87 | | - public void setDataType(MetadataType dataType) { |
|---|
| 88 | | - this.dataType = dataType; |
|---|
| 89 | 59 | } |
|---|
| 90 | 60 | |
|---|
| 91 | 61 | public Application getApplication() { |
|---|
| .. | .. |
|---|
| 120 | 90 | } |
|---|
| 121 | 91 | } |
|---|
| 122 | 92 | |
|---|
| 93 | + public String getValue() { |
|---|
| 94 | + return value; |
|---|
| 95 | + } |
|---|
| 96 | + |
|---|
| 97 | + public void setValue(String value) { |
|---|
| 98 | + this.value = value; |
|---|
| 99 | + } |
|---|
| 100 | + |
|---|
| 101 | + public boolean isMandatory() { |
|---|
| 102 | + return mandatory; |
|---|
| 103 | + } |
|---|
| 104 | + |
|---|
| 105 | + public void setMandatory(boolean mandatory) { |
|---|
| 106 | + this.mandatory = mandatory; |
|---|
| 107 | + } |
|---|
| 108 | + |
|---|
| 109 | + @Override |
|---|
| 110 | + public boolean equals(Object obj) { |
|---|
| 111 | + if (!(obj instanceof ApplicationMetadata)) |
|---|
| 112 | + return false; |
|---|
| 113 | + ApplicationMetadata other = (ApplicationMetadata)obj; |
|---|
| 114 | + return key.equals(other.key) && (application == null || application.equals(other.application)); |
|---|
| 115 | + } |
|---|
| 116 | + |
|---|
| 117 | + @Override |
|---|
| 118 | + public int hashCode() { |
|---|
| 119 | + |
|---|
| 120 | + return key.hashCode() + (application == null ? 0 : application.hashCode()); |
|---|
| 121 | + } |
|---|
| 122 | + |
|---|
| 123 | 123 | } |
|---|