1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.modeshape.connector.store.jpa.util;
25
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.Id;
29 import javax.persistence.NamedQueries;
30 import javax.persistence.NamedQuery;
31 import org.hibernate.ejb.Ejb3Configuration;
32 import org.modeshape.common.util.CheckArg;
33 import org.modeshape.connector.store.jpa.JpaSource;
34 import org.modeshape.connector.store.jpa.Model;
35
36
37
38
39
40
41
42
43 @Entity( name = "MODE_OPTIONS" )
44 @NamedQueries( {@NamedQuery( name = "StoreOptionEntity.findAll", query = "SELECT option FROM MODE_OPTIONS AS option" )} )
45 public class StoreOptionEntity {
46
47 @Id
48 @Column( name = "NAME", nullable = false, length = 512 )
49 private String name;
50
51 @Column( name = "VALUE", nullable = false, length = 512 )
52 private String value;
53
54
55
56
57 protected StoreOptionEntity() {
58 }
59
60
61
62
63
64 public StoreOptionEntity( String name,
65 String value ) {
66 CheckArg.isNotEmpty(name, "name");
67 setName(name);
68 setValue(value);
69 }
70
71
72
73
74 public StoreOptionEntity( String name ) {
75 CheckArg.isNotEmpty(name, "name");
76 setName(name);
77 }
78
79
80
81
82 public String getName() {
83 return name;
84 }
85
86
87
88
89 public void setName( String name ) {
90 this.name = name;
91 }
92
93
94
95
96 public String getValue() {
97 return value;
98 }
99
100
101
102
103 public void setValue( String value ) {
104 this.value = value;
105 }
106
107
108
109
110
111
112 @Override
113 public int hashCode() {
114 return getName().hashCode();
115 }
116
117
118
119
120
121
122 @Override
123 public boolean equals( Object obj ) {
124 if (obj == this) return true;
125 if (obj instanceof StoreOptionEntity) {
126 StoreOptionEntity that = (StoreOptionEntity)obj;
127 if (!this.getName().equals(that.getName())) return false;
128 if (!this.getValue().equals(that.getValue())) return false;
129 return true;
130 }
131 return false;
132 }
133
134
135
136
137
138
139 @Override
140 public String toString() {
141 return "Option " + getName() + " = \"" + getValue() + "\"";
142 }
143 }