aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src
diff options
context:
space:
mode:
authorThomas Knall <t.knall@datentechnik-innovation.com>2015-02-24 11:02:41 +0100
committerThomas Knall <t.knall@datentechnik-innovation.com>2015-02-24 11:02:41 +0100
commitd534f989b469810596fa4a18d64de240377bdfe1 (patch)
tree453cb66ccaa84db57f52fd1d0689f7d4125ba366 /id/server/moa-id-commons/src
parentfd2752d6cb5a95aca7ed2206a9b8258942f17655 (diff)
downloadmoa-id-spss-d534f989b469810596fa4a18d64de240377bdfe1.tar.gz
moa-id-spss-d534f989b469810596fa4a18d64de240377bdfe1.tar.bz2
moa-id-spss-d534f989b469810596fa4a18d64de240377bdfe1.zip
Add key/value configuration entity.
Diffstat (limited to 'id/server/moa-id-commons/src')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigProperty.java95
1 files changed, 95 insertions, 0 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigProperty.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigProperty.java
new file mode 100644
index 000000000..6e2743b81
--- /dev/null
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigProperty.java
@@ -0,0 +1,95 @@
+package at.gv.egovernment.moa.id.commons.db.dao.config;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import javax.persistence.Table;
+
+/**
+ * Reflects a MOAID configuration entry.
+ *
+ */
+@Table(name = "configproperty")
+@Entity
+public class ConfigProperty implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name = "propertyKey", unique = true)
+ private String key;
+
+ @Lob
+ @Column(name = "propertyValue")
+ private String value;
+
+ /**
+ * Returns the property's key.
+ * @return The key.
+ */
+ public String getKey() {
+ return key;
+ }
+
+ /**
+ * Sets the property's key.
+ * @param key The key
+ */
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ /**
+ * Returns the property's value (which might be {@code null}).
+ * @return The property's value (might be {@code null}).
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the property's value.
+ * @param value The value
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((key == null) ? 0 : key.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ConfigProperty other = (ConfigProperty) obj;
+ if (key == null) {
+ if (other.key != null)
+ return false;
+ } else if (!key.equals(other.key))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("ConfigProperty [key=");
+ builder.append(key);
+ builder.append(", value=");
+ builder.append(value);
+ builder.append("]");
+ return builder.toString();
+ }
+}