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