1
2
3
4
5
6
7
8
9 package com.hack23.cia.model.external.riksdagen.documentcontent.impl;
10
11 import java.io.Serializable;
12 import javax.persistence.Basic;
13 import javax.persistence.Column;
14 import javax.persistence.Entity;
15 import javax.persistence.GeneratedValue;
16 import javax.persistence.GenerationType;
17 import javax.persistence.Id;
18 import javax.persistence.Inheritance;
19 import javax.persistence.InheritanceType;
20 import javax.persistence.Table;
21 import javax.xml.bind.annotation.XmlAccessType;
22 import javax.xml.bind.annotation.XmlAccessorType;
23 import javax.xml.bind.annotation.XmlAttribute;
24 import javax.xml.bind.annotation.XmlElement;
25 import javax.xml.bind.annotation.XmlType;
26 import com.hack23.cia.model.common.api.ModelObject;
27 import org.jvnet.jaxb2_commons.lang.Equals;
28 import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
29 import org.jvnet.jaxb2_commons.lang.HashCode;
30 import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
31 import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
32 import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
33 import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
34 import org.jvnet.jaxb2_commons.lang.ToString;
35 import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
36 import org.jvnet.jaxb2_commons.locator.ObjectLocator;
37 import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 @XmlAccessorType(XmlAccessType.FIELD)
61 @XmlType(name = "DocumentContentData", propOrder = {
62 "id",
63 "content"
64 })
65 @Entity(name = "DocumentContentData")
66 @Table(name = "DOCUMENT_CONTENT_DATA")
67 @Inheritance(strategy = InheritanceType.JOINED)
68 public class DocumentContentData
69 implements Serializable, ModelObject, Equals, HashCode, ToString
70 {
71
72 @XmlElement(required = true)
73 protected String id;
74 @XmlElement(required = true)
75 protected String content;
76 @XmlAttribute(name = "Hjid")
77 protected Long hjid;
78
79
80
81
82
83
84
85
86
87 @Basic
88 @Column(name = "ID", length = 255)
89 public String getId() {
90 return id;
91 }
92
93
94
95
96
97
98
99
100
101 public void setId(String value) {
102 this.id = value;
103 }
104
105
106
107
108
109
110
111
112
113 @Basic
114 @Column(name = "CONTENT", length = 10485760)
115 public String getContent() {
116 return content;
117 }
118
119
120
121
122
123
124
125
126
127 public void setContent(String value) {
128 this.content = value;
129 }
130
131 public DocumentContentData withId(String value) {
132 setId(value);
133 return this;
134 }
135
136 public DocumentContentData withContent(String value) {
137 setContent(value);
138 return this;
139 }
140
141 public String toString() {
142 final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
143 final StringBuilder buffer = new StringBuilder();
144 append(null, buffer, strategy);
145 return buffer.toString();
146 }
147
148 public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
149 strategy.appendStart(locator, this, buffer);
150 appendFields(locator, buffer, strategy);
151 strategy.appendEnd(locator, this, buffer);
152 return buffer;
153 }
154
155 public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
156 {
157 String theId;
158 theId = this.getId();
159 strategy.appendField(locator, this, "id", buffer, theId);
160 }
161 {
162 String theContent;
163 theContent = this.getContent();
164 strategy.appendField(locator, this, "content", buffer, theContent);
165 }
166 return buffer;
167 }
168
169
170
171
172
173
174
175
176
177 @Id
178 @Column(name = "HJID")
179 @GeneratedValue(strategy = GenerationType.AUTO)
180 public Long getHjid() {
181 return hjid;
182 }
183
184
185
186
187
188
189
190
191
192 public void setHjid(Long value) {
193 this.hjid = value;
194 }
195
196 public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
197 if ((object == null)||(this.getClass()!= object.getClass())) {
198 return false;
199 }
200 if (this == object) {
201 return true;
202 }
203 final DocumentContentData that = ((DocumentContentData) object);
204 {
205 String lhsId;
206 lhsId = this.getId();
207 String rhsId;
208 rhsId = that.getId();
209 if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId)) {
210 return false;
211 }
212 }
213 {
214 String lhsContent;
215 lhsContent = this.getContent();
216 String rhsContent;
217 rhsContent = that.getContent();
218 if (!strategy.equals(LocatorUtils.property(thisLocator, "content", lhsContent), LocatorUtils.property(thatLocator, "content", rhsContent), lhsContent, rhsContent)) {
219 return false;
220 }
221 }
222 return true;
223 }
224
225 public boolean equals(Object object) {
226 final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
227 return equals(null, null, object, strategy);
228 }
229
230 public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
231 int currentHashCode = 1;
232 {
233 String theId;
234 theId = this.getId();
235 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId);
236 }
237 {
238 String theContent;
239 theContent = this.getContent();
240 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "content", theContent), currentHashCode, theContent);
241 }
242 return currentHashCode;
243 }
244
245 public int hashCode() {
246 final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
247 return this.hashCode(null, strategy);
248 }
249
250 }