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.system.context;
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   * Valeurs par défaut définies sur un contexte
34   */
35  // HibernateEntity.vsl annotations merge-point
36  public abstract class DefaultValue
37      implements Serializable, Comparable<DefaultValue>
38  {
39      /**
40       * The serial version UID of this class. Needed for serialization.
41       */
42      private static final long serialVersionUID = -5555214337854104043L;
43  
44      // Generate 5 attributes
45      private String defaultValueClass;
46  
47      /**
48       * Classe du type d'objet concerné par la valeur par défaut
49       * @return this.defaultValueClass String
50       */
51      public String getDefaultValueClass()
52      {
53          return this.defaultValueClass;
54      }
55  
56      /**
57       * Classe du type d'objet concerné par la valeur par défaut
58       * @param defaultValueClassIn String
59       */
60      public void setDefaultValueClass(String defaultValueClassIn)
61      {
62          this.defaultValueClass = defaultValueClassIn;
63      }
64  
65      private String defaultValueField;
66  
67      /**
68       * Champ du type d'objet concerné par la valeur par défaut
69       * @return this.defaultValueField String
70       */
71      public String getDefaultValueField()
72      {
73          return this.defaultValueField;
74      }
75  
76      /**
77       * Champ du type d'objet concerné par la valeur par défaut
78       * @param defaultValueFieldIn String
79       */
80      public void setDefaultValueField(String defaultValueFieldIn)
81      {
82          this.defaultValueField = defaultValueFieldIn;
83      }
84  
85      private String defaultValueValue;
86  
87      /**
88       * Valeur par défaut du champ
89       * @return this.defaultValueValue String
90       */
91      public String getDefaultValueValue()
92      {
93          return this.defaultValueValue;
94      }
95  
96      /**
97       * Valeur par défaut du champ
98       * @param defaultValueValueIn String
99       */
100     public void setDefaultValueValue(String defaultValueValueIn)
101     {
102         this.defaultValueValue = defaultValueValueIn;
103     }
104 
105     private Timestamp updateDt;
106 
107     /**
108      * Date de mise à jour de l'entité
109      * @return this.updateDt Timestamp
110      */
111     public Timestamp getUpdateDt()
112     {
113         return this.updateDt;
114     }
115 
116     /**
117      * Date de mise à jour de l'entité
118      * @param updateDtIn Timestamp
119      */
120     public void setUpdateDt(Timestamp updateDtIn)
121     {
122         this.updateDt = updateDtIn;
123     }
124 
125     private Integer defaultValueId;
126 
127     /**
128      * 
129      * @return this.defaultValueId Integer
130      */
131     public Integer getDefaultValueId()
132     {
133         return this.defaultValueId;
134     }
135 
136     /**
137      * 
138      * @param defaultValueIdIn Integer
139      */
140     public void setDefaultValueId(Integer defaultValueIdIn)
141     {
142         this.defaultValueId = defaultValueIdIn;
143     }
144 
145     // Generate 1 associations
146     private Context context;
147 
148     /**
149      * Gestion des contextes utilisateur
150      * @return this.context Context
151      */
152     public Context getContext()
153     {
154         return this.context;
155     }
156 
157     /**
158      * Gestion des contextes utilisateur
159      * @param contextIn Context
160      */
161     public void setContext(Context contextIn)
162     {
163         this.context = contextIn;
164     }
165 
166     /**
167      * Returns <code>true</code> if the argument is an DefaultValue instance and all identifiers for this entity
168      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
169      */
170     @Override
171     public boolean equals(Object object)
172     {
173         if (this == object)
174         {
175             return true;
176         }
177         if (!(object instanceof DefaultValue))
178         {
179             return false;
180         }
181         final DefaultValue that = (DefaultValue)object;
182         if (this.defaultValueId == null || that.getDefaultValueId() == null || !this.defaultValueId.equals(that.getDefaultValueId()))
183         {
184             return false;
185         }
186         return true;
187     }
188 
189     /**
190      * Returns a hash code based on this entity's identifiers.
191      */
192     @Override
193     public int hashCode()
194     {
195         int hashCode = 0;
196         hashCode = 29 * hashCode + (this.defaultValueId == null ? 0 : this.defaultValueId.hashCode());
197 
198         return hashCode;
199     }
200 
201     /**
202      * Constructs new instances of {@link DefaultValue}.
203      */
204     public static final class Factory
205     {
206         /**
207          * Constructs a new instance of {@link DefaultValue}.
208          * @return new DefaultValueImpl()
209          */
210         public static DefaultValue newInstance()
211         {
212             return new DefaultValueImpl();
213         }
214 
215 
216         /**
217          * Constructs a new instance of {@link DefaultValue}, taking all possible properties
218          * (except the identifier(s))as arguments.
219          * @param defaultValueClass String
220          * @param defaultValueField String
221          * @param defaultValueValue String
222          * @param updateDt Timestamp
223          * @param context Context
224          * @return newInstance DefaultValue
225          */
226         public static DefaultValue newInstance(String defaultValueClass, String defaultValueField, String defaultValueValue, Timestamp updateDt, Context context)
227         {
228             final DefaultValue entity = new DefaultValueImpl();
229             entity.setDefaultValueClass(defaultValueClass);
230             entity.setDefaultValueField(defaultValueField);
231             entity.setDefaultValueValue(defaultValueValue);
232             entity.setUpdateDt(updateDt);
233             entity.setContext(context);
234             return entity;
235         }
236     }
237 
238     /**
239      * @see Comparable#compareTo
240      */
241     public int compareTo(DefaultValue o)
242     {
243         int cmp = 0;
244         if (this.getDefaultValueId() != null)
245         {
246             cmp = this.getDefaultValueId().compareTo(o.getDefaultValueId());
247         }
248         else
249         {
250             if (this.getDefaultValueClass() != null)
251             {
252                 cmp = (cmp != 0 ? cmp : this.getDefaultValueClass().compareTo(o.getDefaultValueClass()));
253             }
254             if (this.getDefaultValueField() != null)
255             {
256                 cmp = (cmp != 0 ? cmp : this.getDefaultValueField().compareTo(o.getDefaultValueField()));
257             }
258             if (this.getDefaultValueValue() != null)
259             {
260                 cmp = (cmp != 0 ? cmp : this.getDefaultValueValue().compareTo(o.getDefaultValueValue()));
261             }
262             if (this.getUpdateDt() != null)
263             {
264                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
265             }
266         }
267         return cmp;
268     }
269 // HibernateEntity.vsl merge-point
270 // DefaultValue.java merge-point
271 }