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.referential;
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   * Liste des fréquences d'application des stratégies.
33   */
34  // HibernateEntity.vsl annotations merge-point
35  public abstract class Frequency
36      implements Serializable, Comparable<Frequency>
37  {
38      /**
39       * The serial version UID of this class. Needed for serialization.
40       */
41      private static final long serialVersionUID = -2854887277512961609L;
42  
43      // Generate 3 attributes
44      private String freqCd;
45  
46      /**
47       * Code unique de la fréquence d'application des stratégies
48       * @return this.freqCd String
49       */
50      public String getFreqCd()
51      {
52          return this.freqCd;
53      }
54  
55      /**
56       * Code unique de la fréquence d'application des stratégies
57       * @param freqCdIn String
58       */
59      public void setFreqCd(String freqCdIn)
60      {
61          this.freqCd = freqCdIn;
62      }
63  
64      private String freqNm;
65  
66      /**
67       * Libellé de la fréquence
68       * @return this.freqNm String
69       */
70      public String getFreqNm()
71      {
72          return this.freqNm;
73      }
74  
75      /**
76       * Libellé de la fréquence
77       * @param freqNmIn String
78       */
79      public void setFreqNm(String freqNmIn)
80      {
81          this.freqNm = freqNmIn;
82      }
83  
84      private Timestamp updateDt;
85  
86      /**
87       * Date de modification de l'objet, mise à jour par le système
88       * @return this.updateDt Timestamp
89       */
90      public Timestamp getUpdateDt()
91      {
92          return this.updateDt;
93      }
94  
95      /**
96       * Date de modification de l'objet, mise à jour par le système
97       * @param updateDtIn Timestamp
98       */
99      public void setUpdateDt(Timestamp updateDtIn)
100     {
101         this.updateDt = updateDtIn;
102     }
103 
104     // Generate 2 associations
105     private Status status;
106 
107     /**
108      * Liste des états possibles d'un objet.
109      * @return this.status Status
110      */
111     public Status getStatus()
112     {
113         return this.status;
114     }
115 
116     /**
117      * Liste des états possibles d'un objet.
118      * @param statusIn Status
119      */
120     public void setStatus(Status statusIn)
121     {
122         this.status = statusIn;
123     }
124 
125     /**
126      * Returns <code>true</code> if the argument is an Frequency instance and all identifiers for this entity
127      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
128      */
129     @Override
130     public boolean equals(Object object)
131     {
132         if (this == object)
133         {
134             return true;
135         }
136         if (!(object instanceof Frequency))
137         {
138             return false;
139         }
140         final Frequency that = (Frequency)object;
141         if (this.freqCd == null || that.getFreqCd() == null || !this.freqCd.equals(that.getFreqCd()))
142         {
143             return false;
144         }
145         return true;
146     }
147 
148     /**
149      * Returns a hash code based on this entity's identifiers.
150      */
151     @Override
152     public int hashCode()
153     {
154         int hashCode = 0;
155         hashCode = 29 * hashCode + (this.freqCd == null ? 0 : this.freqCd.hashCode());
156 
157         return hashCode;
158     }
159 
160     /**
161      * Constructs new instances of {@link Frequency}.
162      */
163     public static final class Factory
164     {
165         /**
166          * Constructs a new instance of {@link Frequency}.
167          * @return new FrequencyImpl()
168          */
169         public static Frequency newInstance()
170         {
171             return new FrequencyImpl();
172         }
173 
174         /**
175          * Constructs a new instance of {@link Frequency}, taking all required and/or
176          * read-only properties as arguments, except for identifiers.
177          * @param freqNm String
178          * @param status Status
179          * @return newInstance
180          */
181         public static Frequency newInstance(String freqNm, Status status)
182         {
183             final Frequency entity = new FrequencyImpl();
184             entity.setFreqNm(freqNm);
185             entity.setStatus(status);
186             return entity;
187         }
188 
189         /**
190          * Constructs a new instance of {@link Frequency}, taking all possible properties
191          * (except the identifier(s))as arguments.
192          * @param freqNm String
193          * @param updateDt Timestamp
194          * @param status Status
195          * @return newInstance Frequency
196          */
197         public static Frequency newInstance(String freqNm, Timestamp updateDt, Status status)
198         {
199             final Frequency entity = new FrequencyImpl();
200             entity.setFreqNm(freqNm);
201             entity.setUpdateDt(updateDt);
202             entity.setStatus(status);
203             return entity;
204         }
205     }
206 
207     /**
208      * @see Comparable#compareTo
209      */
210     public int compareTo(Frequency o)
211     {
212         int cmp = 0;
213         if (this.getFreqCd() != null)
214         {
215             cmp = this.getFreqCd().compareTo(o.getFreqCd());
216         }
217         else
218         {
219             if (this.getFreqNm() != null)
220             {
221                 cmp = (cmp != 0 ? cmp : this.getFreqNm().compareTo(o.getFreqNm()));
222             }
223             if (this.getUpdateDt() != null)
224             {
225                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
226             }
227         }
228         return cmp;
229     }
230 // HibernateEntity.vsl merge-point
231 // Frequency.java merge-point
232 }