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.system;
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 fr.ifremer.quadrige3.core.dao.data.samplingoperation.SamplingOperation;
29 import java.io.Serializable;
30
31 /**
32 * Gestion de la géométrie ponctuelle des prélèvements.
33 */
34 // HibernateEntity.vsl annotations merge-point
35 public abstract class SamplingOperPoint
36 implements Serializable, Comparable<SamplingOperPoint>
37 {
38 /**
39 * The serial version UID of this class. Needed for serialization.
40 */
41 private static final long serialVersionUID = -5539455338996904038L;
42
43 // Generate 2 attributes
44 private Integer samplingOperId;
45
46 /**
47 *
48 * @return this.samplingOperId Integer
49 */
50 public Integer getSamplingOperId()
51 {
52 return this.samplingOperId;
53 }
54
55 /**
56 *
57 * @param samplingOperIdIn Integer
58 */
59 public void setSamplingOperId(Integer samplingOperIdIn)
60 {
61 this.samplingOperId = samplingOperIdIn;
62 }
63
64 private String samplingOperPosition;
65
66 /**
67 * Positionnement de l'objet
68 * @return this.samplingOperPosition String
69 */
70 public String getSamplingOperPosition()
71 {
72 return this.samplingOperPosition;
73 }
74
75 /**
76 * Positionnement de l'objet
77 * @param samplingOperPositionIn String
78 */
79 public void setSamplingOperPosition(String samplingOperPositionIn)
80 {
81 this.samplingOperPosition = samplingOperPositionIn;
82 }
83
84 // Generate 1 associations
85 private SamplingOperation samplingOperation;
86
87 /**
88 * Liste les prélévements effectués lors d'un passage.
89 * @return this.samplingOperation SamplingOperation
90 */
91 public SamplingOperation getSamplingOperation()
92 {
93 return this.samplingOperation;
94 }
95
96 /**
97 * Liste les prélévements effectués lors d'un passage.
98 * @param samplingOperationIn SamplingOperation
99 */
100 public void setSamplingOperation(SamplingOperation samplingOperationIn)
101 {
102 this.samplingOperation = samplingOperationIn;
103 }
104
105 /**
106 * Returns <code>true</code> if the argument is an SamplingOperPoint 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 SamplingOperPoint))
117 {
118 return false;
119 }
120 final SamplingOperPoint that = (SamplingOperPoint)object;
121 if (this.samplingOperId == null || that.getSamplingOperId() == null || !this.samplingOperId.equals(that.getSamplingOperId()))
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.samplingOperId == null ? 0 : this.samplingOperId.hashCode());
136
137 return hashCode;
138 }
139
140 /**
141 * Constructs new instances of {@link SamplingOperPoint}.
142 */
143 public static final class Factory
144 {
145 /**
146 * Constructs a new instance of {@link SamplingOperPoint}.
147 * @return new SamplingOperPointImpl()
148 */
149 public static SamplingOperPoint newInstance()
150 {
151 return new SamplingOperPointImpl();
152 }
153
154
155 /**
156 * Constructs a new instance of {@link SamplingOperPoint}, taking all possible properties
157 * (except the identifier(s))as arguments.
158 * @param samplingOperPosition String
159 * @param samplingOperation SamplingOperation
160 * @return newInstance SamplingOperPoint
161 */
162 public static SamplingOperPoint newInstance(String samplingOperPosition, SamplingOperation samplingOperation)
163 {
164 final SamplingOperPoint entity = new SamplingOperPointImpl();
165 entity.setSamplingOperPosition(samplingOperPosition);
166 entity.setSamplingOperation(samplingOperation);
167 return entity;
168 }
169 }
170
171 /**
172 * @see Comparable#compareTo
173 */
174 public int compareTo(SamplingOperPoint o)
175 {
176 int cmp = 0;
177 if (this.getSamplingOperId() != null)
178 {
179 cmp = this.getSamplingOperId().compareTo(o.getSamplingOperId());
180 }
181 else
182 {
183 if (this.getSamplingOperPosition() != null)
184 {
185 cmp = (cmp != 0 ? cmp : this.getSamplingOperPosition().compareTo(o.getSamplingOperPosition()));
186 }
187 }
188 return cmp;
189 }
190 // HibernateEntity.vsl merge-point
191 // SamplingOperPoint.java merge-point
192 }