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.quadrige3.core.dao.administration.program;
7   
8   /*-
9    * #%L
10   * Quadrige3 Core :: Client API
11   * %%
12   * Copyright (C) 2017 - 2024 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  import java.io.Serializable;
29  import java.sql.Timestamp;
30  
31  /**
32   * 
33   */
34  // HibernateEntity.vsl annotations merge-point
35  public abstract class AlrtMonLocProg
36      implements Serializable, Comparable<AlrtMonLocProg>
37  {
38      /**
39       * The serial version UID of this class. Needed for serialization.
40       */
41      private static final long serialVersionUID = 1600799467217069398L;
42  
43      // Generate 3 attributes
44      private Integer monLocId;
45  
46      /**
47       * 
48       * @return this.monLocId Integer
49       */
50      public Integer getMonLocId()
51      {
52          return this.monLocId;
53      }
54  
55      /**
56       * 
57       * @param monLocIdIn Integer
58       */
59      public void setMonLocId(Integer monLocIdIn)
60      {
61          this.monLocId = monLocIdIn;
62      }
63  
64      private String progCd;
65  
66      /**
67       * 
68       * @return this.progCd String
69       */
70      public String getProgCd()
71      {
72          return this.progCd;
73      }
74  
75      /**
76       * 
77       * @param progCdIn String
78       */
79      public void setProgCd(String progCdIn)
80      {
81          this.progCd = progCdIn;
82      }
83  
84      private Timestamp updateDt;
85  
86      /**
87       * 
88       * @return this.updateDt Timestamp
89       */
90      public Timestamp getUpdateDt()
91      {
92          return this.updateDt;
93      }
94  
95      /**
96       * 
97       * @param updateDtIn Timestamp
98       */
99      public void setUpdateDt(Timestamp updateDtIn)
100     {
101         this.updateDt = updateDtIn;
102     }
103 
104     // Generate 0 associations
105     /**
106      * Returns <code>true</code> if the argument is an AlrtMonLocProg instance and all identifiers for this entity
107      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
108      */
109     @Override
110     public boolean equals(Object object)
111     {
112         if (this == object)
113         {
114             return true;
115         }
116         if (!(object instanceof AlrtMonLocProg))
117         {
118             return false;
119         }
120         final AlrtMonLocProg that = (AlrtMonLocProg)object;
121         if (this.monLocId == null || that.getMonLocId() == null || !this.monLocId.equals(that.getMonLocId()))
122         {
123             return false;
124         }
125         return true;
126     }
127 
128     /**
129      * Returns a hash code based on this entity's identifiers.
130      */
131     @Override
132     public int hashCode()
133     {
134         int hashCode = 0;
135         hashCode = 29 * hashCode + (this.monLocId == null ? 0 : this.monLocId.hashCode());
136 
137         return hashCode;
138     }
139 
140     /**
141      * Constructs new instances of {@link AlrtMonLocProg}.
142      */
143     public static final class Factory
144     {
145         /**
146          * Constructs a new instance of {@link AlrtMonLocProg}.
147          * @return new AlrtMonLocProgImpl()
148          */
149         public static AlrtMonLocProg newInstance()
150         {
151             return new AlrtMonLocProgImpl();
152         }
153 
154         /**
155          * Constructs a new instance of {@link AlrtMonLocProg}, taking all required and/or
156          * read-only properties as arguments, except for identifiers.
157          * @param progCd String
158          * @return newInstance
159          */
160         public static AlrtMonLocProg newInstance(String progCd)
161         {
162             final AlrtMonLocProg entity = new AlrtMonLocProgImpl();
163             entity.setProgCd(progCd);
164             return entity;
165         }
166 
167         /**
168          * Constructs a new instance of {@link AlrtMonLocProg}, taking all possible properties
169          * (except the identifier(s))as arguments.
170          * @param progCd String
171          * @param updateDt Timestamp
172          * @return newInstance AlrtMonLocProg
173          */
174         public static AlrtMonLocProg newInstance(String progCd, Timestamp updateDt)
175         {
176             final AlrtMonLocProg entity = new AlrtMonLocProgImpl();
177             entity.setProgCd(progCd);
178             entity.setUpdateDt(updateDt);
179             return entity;
180         }
181     }
182 
183     /**
184      * @see Comparable#compareTo
185      */
186     public int compareTo(AlrtMonLocProg o)
187     {
188         int cmp = 0;
189         if (this.getMonLocId() != null)
190         {
191             cmp = this.getMonLocId().compareTo(o.getMonLocId());
192         }
193         else
194         {
195             if (this.getProgCd() != null)
196             {
197                 cmp = (cmp != 0 ? cmp : this.getProgCd().compareTo(o.getProgCd()));
198             }
199             if (this.getUpdateDt() != null)
200             {
201                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
202             }
203         }
204         return cmp;
205     }
206 // HibernateEntity.vsl merge-point
207 // AlrtMonLocProg.java merge-point
208 }