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.survey.Survey;
29 import java.io.Serializable;
30
31 /**
32 * Gestino de la géométrie linéaire des passages.
33 */
34 // HibernateEntity.vsl annotations merge-point
35 public abstract class SurveyLine
36 implements Serializable, Comparable<SurveyLine>
37 {
38 /**
39 * The serial version UID of this class. Needed for serialization.
40 */
41 private static final long serialVersionUID = -326936635607894780L;
42
43 // Generate 2 attributes
44 private Integer surveyId;
45
46 /**
47 *
48 * @return this.surveyId Integer
49 */
50 public Integer getSurveyId()
51 {
52 return this.surveyId;
53 }
54
55 /**
56 *
57 * @param surveyIdIn Integer
58 */
59 public void setSurveyId(Integer surveyIdIn)
60 {
61 this.surveyId = surveyIdIn;
62 }
63
64 private String surveyPosition;
65
66 /**
67 * Positionnement de l'objet
68 * @return this.surveyPosition String
69 */
70 public String getSurveyPosition()
71 {
72 return this.surveyPosition;
73 }
74
75 /**
76 * Positionnement de l'objet
77 * @param surveyPositionIn String
78 */
79 public void setSurveyPosition(String surveyPositionIn)
80 {
81 this.surveyPosition = surveyPositionIn;
82 }
83
84 // Generate 1 associations
85 private Survey survey;
86
87 /**
88 * Liste les différents passages effectués sur un lieu de surveillance.
89 * Liste les différents passages effectués sur un lieu de surveillance.
90 * @return this.survey Survey
91 */
92 public Survey getSurvey()
93 {
94 return this.survey;
95 }
96
97 /**
98 * Liste les différents passages effectués sur un lieu de surveillance.
99 * Liste les différents passages effectués sur un lieu de surveillance.
100 * @param surveyIn Survey
101 */
102 public void setSurvey(Survey surveyIn)
103 {
104 this.survey = surveyIn;
105 }
106
107 /**
108 * Returns <code>true</code> if the argument is an SurveyLine instance and all identifiers for this entity
109 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
110 */
111 @Override
112 public boolean equals(Object object)
113 {
114 if (this == object)
115 {
116 return true;
117 }
118 if (!(object instanceof SurveyLine))
119 {
120 return false;
121 }
122 final SurveyLine that = (SurveyLine)object;
123 if (this.surveyId == null || that.getSurveyId() == null || !this.surveyId.equals(that.getSurveyId()))
124 {
125 return false;
126 }
127 return true;
128 }
129
130 /**
131 * Returns a hash code based on this entity's identifiers.
132 */
133 @Override
134 public int hashCode()
135 {
136 int hashCode = 0;
137 hashCode = 29 * hashCode + (this.surveyId == null ? 0 : this.surveyId.hashCode());
138
139 return hashCode;
140 }
141
142 /**
143 * Constructs new instances of {@link SurveyLine}.
144 */
145 public static final class Factory
146 {
147 /**
148 * Constructs a new instance of {@link SurveyLine}.
149 * @return new SurveyLineImpl()
150 */
151 public static SurveyLine newInstance()
152 {
153 return new SurveyLineImpl();
154 }
155
156
157 /**
158 * Constructs a new instance of {@link SurveyLine}, taking all possible properties
159 * (except the identifier(s))as arguments.
160 * @param surveyPosition String
161 * @param survey Survey
162 * @return newInstance SurveyLine
163 */
164 public static SurveyLine newInstance(String surveyPosition, Survey survey)
165 {
166 final SurveyLine entity = new SurveyLineImpl();
167 entity.setSurveyPosition(surveyPosition);
168 entity.setSurvey(survey);
169 return entity;
170 }
171 }
172
173 /**
174 * @see Comparable#compareTo
175 */
176 public int compareTo(SurveyLine o)
177 {
178 int cmp = 0;
179 if (this.getSurveyId() != null)
180 {
181 cmp = this.getSurveyId().compareTo(o.getSurveyId());
182 }
183 else
184 {
185 if (this.getSurveyPosition() != null)
186 {
187 cmp = (cmp != 0 ? cmp : this.getSurveyPosition().compareTo(o.getSurveyPosition()));
188 }
189 }
190 return cmp;
191 }
192 // HibernateEntity.vsl merge-point
193 // SurveyLine.java merge-point
194 }