View Javadoc
1   //
2   // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 
3   // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
4   // Any modifications to this file will be lost upon recompilation of the source schema. 
5   // Generated on: 2017.04.23 at 07:23:18 PM CEST 
6   //
7   
8   
9   package com.hack23.cia.model.internal.application.system.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.Basic;
16  import javax.persistence.CascadeType;
17  import javax.persistence.Column;
18  import javax.persistence.Entity;
19  import javax.persistence.GeneratedValue;
20  import javax.persistence.GenerationType;
21  import javax.persistence.Id;
22  import javax.persistence.Inheritance;
23  import javax.persistence.InheritanceType;
24  import javax.persistence.JoinColumn;
25  import javax.persistence.OneToMany;
26  import javax.persistence.Table;
27  import javax.xml.bind.annotation.XmlAccessType;
28  import javax.xml.bind.annotation.XmlAccessorType;
29  import javax.xml.bind.annotation.XmlAttribute;
30  import javax.xml.bind.annotation.XmlElement;
31  import javax.xml.bind.annotation.XmlType;
32  import com.hack23.cia.model.common.api.ModelObject;
33  import org.jvnet.jaxb2_commons.lang.Equals;
34  import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
35  import org.jvnet.jaxb2_commons.lang.HashCode;
36  import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
37  import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
38  import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
39  import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
40  import org.jvnet.jaxb2_commons.lang.ToString;
41  import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
42  import org.jvnet.jaxb2_commons.locator.ObjectLocator;
43  import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
44  
45  
46  /**
47   * <p>Java class for Agency complex type.
48   * 
49   * <p>The following schema fragment specifies the expected content contained within this class.
50   * 
51   * <pre>
52   * &lt;complexType name="Agency"&gt;
53   *   &lt;complexContent&gt;
54   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
55   *       &lt;sequence&gt;
56   *         &lt;element name="modelObjectId" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt;
57   *         &lt;element name="modelObjectVersion" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt;
58   *         &lt;element name="agencyName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
59   *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
60   *         &lt;element name="portals" type="{http://system.application.internal.model.cia.hack23.com/impl}Portal" maxOccurs="unbounded" minOccurs="0"/&gt;
61   *       &lt;/sequence&gt;
62   *     &lt;/restriction&gt;
63   *   &lt;/complexContent&gt;
64   * &lt;/complexType&gt;
65   * </pre>
66   * 
67   * 
68   */
69  @XmlAccessorType(XmlAccessType.FIELD)
70  @XmlType(name = "Agency", propOrder = {
71      "modelObjectId",
72      "modelObjectVersion",
73      "agencyName",
74      "description",
75      "portals"
76  })
77  @Entity(name = "Agency")
78  @Table(name = "AGENCY")
79  @Inheritance(strategy = InheritanceType.JOINED)
80  public class Agency
81      implements Serializable, ModelObject, Equals, HashCode, ToString
82  {
83  
84      private final static long serialVersionUID = 1L;
85      protected Integer modelObjectId;
86      protected Integer modelObjectVersion;
87      protected String agencyName;
88      protected String description;
89      @XmlElement(nillable = true)
90      protected List<Portal> portals;
91      @XmlAttribute(name = "Hjid")
92      protected Long hjid;
93  
94      /**
95       * Gets the value of the modelObjectId property.
96       * 
97       * @return
98       *     possible object is
99       *     {@link Integer }
100      *     
101      */
102     @Basic
103     @Column(name = "MODEL_OBJECT_ID", precision = 10, scale = 0)
104     public Integer getModelObjectId() {
105         return modelObjectId;
106     }
107 
108     /**
109      * Sets the value of the modelObjectId property.
110      * 
111      * @param value
112      *     allowed object is
113      *     {@link Integer }
114      *     
115      */
116     public void setModelObjectId(Integer value) {
117         this.modelObjectId = value;
118     }
119 
120     /**
121      * Gets the value of the modelObjectVersion property.
122      * 
123      * @return
124      *     possible object is
125      *     {@link Integer }
126      *     
127      */
128     @Basic
129     @Column(name = "MODEL_OBJECT_VERSION", precision = 10, scale = 0)
130     public Integer getModelObjectVersion() {
131         return modelObjectVersion;
132     }
133 
134     /**
135      * Sets the value of the modelObjectVersion property.
136      * 
137      * @param value
138      *     allowed object is
139      *     {@link Integer }
140      *     
141      */
142     public void setModelObjectVersion(Integer value) {
143         this.modelObjectVersion = value;
144     }
145 
146     /**
147      * Gets the value of the agencyName property.
148      * 
149      * @return
150      *     possible object is
151      *     {@link String }
152      *     
153      */
154     @Basic
155     @Column(name = "AGENCY_NAME", length = 255)
156     public String getAgencyName() {
157         return agencyName;
158     }
159 
160     /**
161      * Sets the value of the agencyName property.
162      * 
163      * @param value
164      *     allowed object is
165      *     {@link String }
166      *     
167      */
168     public void setAgencyName(String value) {
169         this.agencyName = value;
170     }
171 
172     /**
173      * Gets the value of the description property.
174      * 
175      * @return
176      *     possible object is
177      *     {@link String }
178      *     
179      */
180     @Basic
181     @Column(name = "DESCRIPTION", length = 255)
182     public String getDescription() {
183         return description;
184     }
185 
186     /**
187      * Sets the value of the description property.
188      * 
189      * @param value
190      *     allowed object is
191      *     {@link String }
192      *     
193      */
194     public void setDescription(String value) {
195         this.description = value;
196     }
197 
198     /**
199      * Gets the value of the portals property.
200      * 
201      * <p>
202      * This accessor method returns a reference to the live list,
203      * not a snapshot. Therefore any modification you make to the
204      * returned list will be present inside the JAXB object.
205      * This is why there is not a <CODE>set</CODE> method for the portals property.
206      * 
207      * <p>
208      * For example, to add a new item, do as follows:
209      * <pre>
210      *    getPortals().add(newItem);
211      * </pre>
212      * 
213      * 
214      * <p>
215      * Objects of the following type(s) are allowed in the list
216      * {@link Portal }
217      * 
218      * 
219      */
220     @OneToMany(targetEntity = Portal.class, cascade = {
221         CascadeType.ALL
222     })
223     @JoinColumn(name = "PORTALS_AGENCY_HJID")
224     public List<Portal> getPortals() {
225         if (portals == null) {
226             portals = new ArrayList<Portal>();
227         }
228         return this.portals;
229     }
230 
231     /**
232      * 
233      * 
234      */
235     public void setPortals(List<Portal> portals) {
236         this.portals = portals;
237     }
238 
239     public Agency withModelObjectId(Integer value) {
240         setModelObjectId(value);
241         return this;
242     }
243 
244     public Agency withModelObjectVersion(Integer value) {
245         setModelObjectVersion(value);
246         return this;
247     }
248 
249     public Agency withAgencyName(String value) {
250         setAgencyName(value);
251         return this;
252     }
253 
254     public Agency withDescription(String value) {
255         setDescription(value);
256         return this;
257     }
258 
259     public Agency withPortals(Portal... values) {
260         if (values!= null) {
261             for (Portal value: values) {
262                 getPortals().add(value);
263             }
264         }
265         return this;
266     }
267 
268     public Agency withPortals(Collection<Portal> values) {
269         if (values!= null) {
270             getPortals().addAll(values);
271         }
272         return this;
273     }
274 
275     public Agency withPortals(List<Portal> portals) {
276         setPortals(portals);
277         return this;
278     }
279 
280     public String toString() {
281         final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
282         final StringBuilder buffer = new StringBuilder();
283         append(null, buffer, strategy);
284         return buffer.toString();
285     }
286 
287     public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
288         strategy.appendStart(locator, this, buffer);
289         appendFields(locator, buffer, strategy);
290         strategy.appendEnd(locator, this, buffer);
291         return buffer;
292     }
293 
294     public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
295         {
296             Integer theModelObjectId;
297             theModelObjectId = this.getModelObjectId();
298             strategy.appendField(locator, this, "modelObjectId", buffer, theModelObjectId);
299         }
300         {
301             Integer theModelObjectVersion;
302             theModelObjectVersion = this.getModelObjectVersion();
303             strategy.appendField(locator, this, "modelObjectVersion", buffer, theModelObjectVersion);
304         }
305         {
306             String theAgencyName;
307             theAgencyName = this.getAgencyName();
308             strategy.appendField(locator, this, "agencyName", buffer, theAgencyName);
309         }
310         {
311             String theDescription;
312             theDescription = this.getDescription();
313             strategy.appendField(locator, this, "description", buffer, theDescription);
314         }
315         {
316             List<Portal> thePortals;
317             thePortals = (((this.portals!= null)&&(!this.portals.isEmpty()))?this.getPortals():null);
318             strategy.appendField(locator, this, "portals", buffer, thePortals);
319         }
320         return buffer;
321     }
322 
323     /**
324      * Gets the value of the hjid property.
325      * 
326      * @return
327      *     possible object is
328      *     {@link Long }
329      *     
330      */
331     @Id
332     @Column(name = "HJID")
333     @GeneratedValue(strategy = GenerationType.AUTO)
334     public Long getHjid() {
335         return hjid;
336     }
337 
338     /**
339      * Sets the value of the hjid property.
340      * 
341      * @param value
342      *     allowed object is
343      *     {@link Long }
344      *     
345      */
346     public void setHjid(Long value) {
347         this.hjid = value;
348     }
349 
350     public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
351         if ((object == null)||(this.getClass()!= object.getClass())) {
352             return false;
353         }
354         if (this == object) {
355             return true;
356         }
357         final Agency that = ((Agency) object);
358         {
359             Integer lhsModelObjectId;
360             lhsModelObjectId = this.getModelObjectId();
361             Integer rhsModelObjectId;
362             rhsModelObjectId = that.getModelObjectId();
363             if (!strategy.equals(LocatorUtils.property(thisLocator, "modelObjectId", lhsModelObjectId), LocatorUtils.property(thatLocator, "modelObjectId", rhsModelObjectId), lhsModelObjectId, rhsModelObjectId)) {
364                 return false;
365             }
366         }
367         {
368             Integer lhsModelObjectVersion;
369             lhsModelObjectVersion = this.getModelObjectVersion();
370             Integer rhsModelObjectVersion;
371             rhsModelObjectVersion = that.getModelObjectVersion();
372             if (!strategy.equals(LocatorUtils.property(thisLocator, "modelObjectVersion", lhsModelObjectVersion), LocatorUtils.property(thatLocator, "modelObjectVersion", rhsModelObjectVersion), lhsModelObjectVersion, rhsModelObjectVersion)) {
373                 return false;
374             }
375         }
376         {
377             String lhsAgencyName;
378             lhsAgencyName = this.getAgencyName();
379             String rhsAgencyName;
380             rhsAgencyName = that.getAgencyName();
381             if (!strategy.equals(LocatorUtils.property(thisLocator, "agencyName", lhsAgencyName), LocatorUtils.property(thatLocator, "agencyName", rhsAgencyName), lhsAgencyName, rhsAgencyName)) {
382                 return false;
383             }
384         }
385         {
386             String lhsDescription;
387             lhsDescription = this.getDescription();
388             String rhsDescription;
389             rhsDescription = that.getDescription();
390             if (!strategy.equals(LocatorUtils.property(thisLocator, "description", lhsDescription), LocatorUtils.property(thatLocator, "description", rhsDescription), lhsDescription, rhsDescription)) {
391                 return false;
392             }
393         }
394         {
395             List<Portal> lhsPortals;
396             lhsPortals = (((this.portals!= null)&&(!this.portals.isEmpty()))?this.getPortals():null);
397             List<Portal> rhsPortals;
398             rhsPortals = (((that.portals!= null)&&(!that.portals.isEmpty()))?that.getPortals():null);
399             if (!strategy.equals(LocatorUtils.property(thisLocator, "portals", lhsPortals), LocatorUtils.property(thatLocator, "portals", rhsPortals), lhsPortals, rhsPortals)) {
400                 return false;
401             }
402         }
403         return true;
404     }
405 
406     public boolean equals(Object object) {
407         final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
408         return equals(null, null, object, strategy);
409     }
410 
411     public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
412         int currentHashCode = 1;
413         {
414             Integer theModelObjectId;
415             theModelObjectId = this.getModelObjectId();
416             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "modelObjectId", theModelObjectId), currentHashCode, theModelObjectId);
417         }
418         {
419             Integer theModelObjectVersion;
420             theModelObjectVersion = this.getModelObjectVersion();
421             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "modelObjectVersion", theModelObjectVersion), currentHashCode, theModelObjectVersion);
422         }
423         {
424             String theAgencyName;
425             theAgencyName = this.getAgencyName();
426             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "agencyName", theAgencyName), currentHashCode, theAgencyName);
427         }
428         {
429             String theDescription;
430             theDescription = this.getDescription();
431             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "description", theDescription), currentHashCode, theDescription);
432         }
433         {
434             List<Portal> thePortals;
435             thePortals = (((this.portals!= null)&&(!this.portals.isEmpty()))?this.getPortals():null);
436             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "portals", thePortals), currentHashCode, thePortals);
437         }
438         return currentHashCode;
439     }
440 
441     public int hashCode() {
442         final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
443         return this.hashCode(null, strategy);
444     }
445 
446 }