View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: Generated code! Do not modify by hand!
4   // Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge.
5   //
6   package fr.ifremer.quadrige2.core.dao.referential;
7   
8   /*-
9    * #%L
10   * Quadrige2 Core :: Server API
11   * %%
12   * Copyright (C) 2017 Ifremer
13   * %%
14   * This program is free software: you can redistribute it and/or modify
15   * it under the terms of the GNU Affero General Public License as published by
16   * the Free Software Foundation, either version 3 of the License, or
17   * (at your option) any later version.
18   * 
19   * This program is distributed in the hope that it will be useful,
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22   * GNU General Public License for more details.
23   * 
24   * You should have received a copy of the GNU Affero General Public License
25   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
26   * #L%
27   */
28  
29  import java.io.Serializable;
30  import java.sql.Timestamp;
31  
32  /**
33   * Masse d'eau DCE
34   */
35  // HibernateEntity.vsl annotations merge-point
36  public abstract class WfdWaterBody
37      implements Serializable, Comparable<WfdWaterBody>
38  {
39      /**
40       * The serial version UID of this class. Needed for serialization.
41       */
42      private static final long serialVersionUID = 3361040340612646391L;
43  
44      // Generate 3 attributes
45      private String wfdWaterBodyCd;
46  
47      /**
48       * Code de la masse d'eau
49       * @return this.wfdWaterBodyCd String
50       */
51      public String getWfdWaterBodyCd()
52      {
53          return this.wfdWaterBodyCd;
54      }
55  
56      /**
57       * Code de la masse d'eau
58       * @param wfdWaterBodyCdIn String
59       */
60      public void setWfdWaterBodyCd(String wfdWaterBodyCdIn)
61      {
62          this.wfdWaterBodyCd = wfdWaterBodyCdIn;
63      }
64  
65      private String wfdWaterBodyNm;
66  
67      /**
68       * Libellé de la masse d'eau
69       * @return this.wfdWaterBodyNm String
70       */
71      public String getWfdWaterBodyNm()
72      {
73          return this.wfdWaterBodyNm;
74      }
75  
76      /**
77       * Libellé de la masse d'eau
78       * @param wfdWaterBodyNmIn String
79       */
80      public void setWfdWaterBodyNm(String wfdWaterBodyNmIn)
81      {
82          this.wfdWaterBodyNm = wfdWaterBodyNmIn;
83      }
84  
85      private Timestamp updateDt;
86  
87      /**
88       * Date de modification de l'objet, mise à jour par le système
89       * @return this.updateDt Timestamp
90       */
91      public Timestamp getUpdateDt()
92      {
93          return this.updateDt;
94      }
95  
96      /**
97       * Date de modification de l'objet, mise à jour par le système
98       * @param updateDtIn Timestamp
99       */
100     public void setUpdateDt(Timestamp updateDtIn)
101     {
102         this.updateDt = updateDtIn;
103     }
104 
105     // Generate 0 associations
106     /**
107      * Returns <code>true</code> if the argument is an WfdWaterBody instance and all identifiers for this entity
108      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
109      */
110     @Override
111     public boolean equals(Object object)
112     {
113         if (this == object)
114         {
115             return true;
116         }
117         if (!(object instanceof WfdWaterBody))
118         {
119             return false;
120         }
121         final WfdWaterBody that = (WfdWaterBody)object;
122         if (this.wfdWaterBodyCd == null || that.getWfdWaterBodyCd() == null || !this.wfdWaterBodyCd.equals(that.getWfdWaterBodyCd()))
123         {
124             return false;
125         }
126         return true;
127     }
128 
129     /**
130      * Returns a hash code based on this entity's identifiers.
131      */
132     @Override
133     public int hashCode()
134     {
135         int hashCode = 0;
136         hashCode = 29 * hashCode + (this.wfdWaterBodyCd == null ? 0 : this.wfdWaterBodyCd.hashCode());
137 
138         return hashCode;
139     }
140 
141     /**
142      * Constructs new instances of {@link WfdWaterBody}.
143      */
144     public static final class Factory
145     {
146         /**
147          * Constructs a new instance of {@link WfdWaterBody}.
148          * @return new WfdWaterBodyImpl()
149          */
150         public static WfdWaterBody newInstance()
151         {
152             return new WfdWaterBodyImpl();
153         }
154 
155 
156         /**
157          * Constructs a new instance of {@link WfdWaterBody}, taking all possible properties
158          * (except the identifier(s))as arguments.
159          * @param wfdWaterBodyNm String
160          * @param updateDt Timestamp
161          * @return newInstance WfdWaterBody
162          */
163         public static WfdWaterBody newInstance(String wfdWaterBodyNm, Timestamp updateDt)
164         {
165             final WfdWaterBody entity = new WfdWaterBodyImpl();
166             entity.setWfdWaterBodyNm(wfdWaterBodyNm);
167             entity.setUpdateDt(updateDt);
168             return entity;
169         }
170     }
171 
172     /**
173      * @see Comparable#compareTo
174      */
175     public int compareTo(WfdWaterBody o)
176     {
177         int cmp = 0;
178         if (this.getWfdWaterBodyCd() != null)
179         {
180             cmp = this.getWfdWaterBodyCd().compareTo(o.getWfdWaterBodyCd());
181         }
182         else
183         {
184             if (this.getWfdWaterBodyNm() != null)
185             {
186                 cmp = (cmp != 0 ? cmp : this.getWfdWaterBodyNm().compareTo(o.getWfdWaterBodyNm()));
187             }
188             if (this.getUpdateDt() != null)
189             {
190                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
191             }
192         }
193         return cmp;
194     }
195 // HibernateEntity.vsl merge-point
196 // WfdWaterBody.java merge-point
197 }