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