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:22:42 PM CEST 
6   //
7   
8   
9   package com.hack23.cia.model.external.riksdagen.dokumentstatus.impl;
10  
11  import java.io.Serializable;
12  import javax.persistence.CascadeType;
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.JoinColumn;
21  import javax.persistence.ManyToOne;
22  import javax.persistence.Table;
23  import javax.xml.bind.annotation.XmlAccessType;
24  import javax.xml.bind.annotation.XmlAccessorType;
25  import javax.xml.bind.annotation.XmlAttribute;
26  import javax.xml.bind.annotation.XmlElement;
27  import javax.xml.bind.annotation.XmlType;
28  import com.hack23.cia.model.common.api.ModelObject;
29  import org.jvnet.jaxb2_commons.lang.Equals;
30  import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
31  import org.jvnet.jaxb2_commons.lang.HashCode;
32  import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
33  import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
34  import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
35  import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
36  import org.jvnet.jaxb2_commons.lang.ToString;
37  import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
38  import org.jvnet.jaxb2_commons.locator.ObjectLocator;
39  import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
40  
41  
42  /**
43   * <p>Java class for DocumentProposalContainer complex type.
44   * 
45   * <p>The following schema fragment specifies the expected content contained within this class.
46   * 
47   * <pre>
48   * &lt;complexType name="DocumentProposalContainer"&gt;
49   *   &lt;complexContent&gt;
50   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
51   *       &lt;sequence&gt;
52   *         &lt;element name="forslag" type="{http://dokumentstatus.riksdagen.external.model.cia.hack23.com/impl}DocumentProposalData"/&gt;
53   *       &lt;/sequence&gt;
54   *     &lt;/restriction&gt;
55   *   &lt;/complexContent&gt;
56   * &lt;/complexType&gt;
57   * </pre>
58   * 
59   * 
60   */
61  @XmlAccessorType(XmlAccessType.FIELD)
62  @XmlType(name = "DocumentProposalContainer", propOrder = {
63      "proposal"
64  })
65  @Entity(name = "DocumentProposalContainer")
66  @Table(name = "DOCUMENT_PROPOSAL_CONTAINER")
67  @Inheritance(strategy = InheritanceType.JOINED)
68  public class DocumentProposalContainer
69      implements Serializable, ModelObject, Equals, HashCode, ToString
70  {
71  
72      @XmlElement(name = "forslag", required = true)
73      protected DocumentProposalData proposal;
74      @XmlAttribute(name = "Hjid")
75      protected Long hjid;
76  
77      /**
78       * Gets the value of the proposal property.
79       * 
80       * @return
81       *     possible object is
82       *     {@link DocumentProposalData }
83       *     
84       */
85      @ManyToOne(targetEntity = DocumentProposalData.class, cascade = {
86          CascadeType.ALL
87      })
88      @JoinColumn(name = "PROPOSAL_DOCUMENT_PROPOSAL_C_0")
89      public DocumentProposalData getProposal() {
90          return proposal;
91      }
92  
93      /**
94       * Sets the value of the proposal property.
95       * 
96       * @param value
97       *     allowed object is
98       *     {@link DocumentProposalData }
99       *     
100      */
101     public void setProposal(DocumentProposalData value) {
102         this.proposal = value;
103     }
104 
105     public DocumentProposalContainer withProposal(DocumentProposalData value) {
106         setProposal(value);
107         return this;
108     }
109 
110     public String toString() {
111         final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
112         final StringBuilder buffer = new StringBuilder();
113         append(null, buffer, strategy);
114         return buffer.toString();
115     }
116 
117     public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
118         strategy.appendStart(locator, this, buffer);
119         appendFields(locator, buffer, strategy);
120         strategy.appendEnd(locator, this, buffer);
121         return buffer;
122     }
123 
124     public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
125         {
126             DocumentProposalData theProposal;
127             theProposal = this.getProposal();
128             strategy.appendField(locator, this, "proposal", buffer, theProposal);
129         }
130         return buffer;
131     }
132 
133     /**
134      * Gets the value of the hjid property.
135      * 
136      * @return
137      *     possible object is
138      *     {@link Long }
139      *     
140      */
141     @Id
142     @Column(name = "HJID")
143     @GeneratedValue(strategy = GenerationType.AUTO)
144     public Long getHjid() {
145         return hjid;
146     }
147 
148     /**
149      * Sets the value of the hjid property.
150      * 
151      * @param value
152      *     allowed object is
153      *     {@link Long }
154      *     
155      */
156     public void setHjid(Long value) {
157         this.hjid = value;
158     }
159 
160     public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
161         if ((object == null)||(this.getClass()!= object.getClass())) {
162             return false;
163         }
164         if (this == object) {
165             return true;
166         }
167         final DocumentProposalContainer that = ((DocumentProposalContainer) object);
168         {
169             DocumentProposalData lhsProposal;
170             lhsProposal = this.getProposal();
171             DocumentProposalData rhsProposal;
172             rhsProposal = that.getProposal();
173             if (!strategy.equals(LocatorUtils.property(thisLocator, "proposal", lhsProposal), LocatorUtils.property(thatLocator, "proposal", rhsProposal), lhsProposal, rhsProposal)) {
174                 return false;
175             }
176         }
177         return true;
178     }
179 
180     public boolean equals(Object object) {
181         final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
182         return equals(null, null, object, strategy);
183     }
184 
185     public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
186         int currentHashCode = 1;
187         {
188             DocumentProposalData theProposal;
189             theProposal = this.getProposal();
190             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "proposal", theProposal), currentHashCode, theProposal);
191         }
192         return currentHashCode;
193     }
194 
195     public int hashCode() {
196         final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
197         return this.hashCode(null, strategy);
198     }
199 
200 }