001// license-header java merge-point 002// 003// Attention: Generated code! Do not modify by hand! 004// Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge. 005// 006package fr.ifremer.adagio.core.dao.referential.location; 007 008/* 009 * #%L 010 * SIH-Adagio :: Core 011 * $Id:$ 012 * $HeadURL:$ 013 * %% 014 * Copyright (C) 2012 - 2014 Ifremer 015 * %% 016 * This program is free software: you can redistribute it and/or modify 017 * it under the terms of the GNU Affero General Public License as published by 018 * the Free Software Foundation, either version 3 of the License, or 019 * (at your option) any later version. 020 * 021 * This program is distributed in the hope that it will be useful, 022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 024 * GNU General Public License for more details. 025 * 026 * You should have received a copy of the GNU Affero General Public License 027 * along with this program. If not, see <http://www.gnu.org/licenses/>. 028 * #L% 029 */ 030 031import com.vividsolutions.jts.geom.Point; 032import fr.ifremer.adagio.core.dao.referential.Status; 033import fr.ifremer.adagio.core.dao.referential.ValidityStatus; 034import java.sql.Timestamp; 035 036/** 037 * <html> 038 * <head> 039 * <style> 040 * p {padding:0px; margin:0px;} 041 * </style> 042 * </head> 043 * <body> 044 * <p> 045 * Géomtérie ponctuelle (multi point) associée au lieu. 046 * </p> 047 * </body> 048 * </html> 049 */ 050// HibernateEntity.vsl annotations merge-point 051public abstract class LocationPoint 052 extends LocationImpl 053{ 054 /** 055 * The serial version UID of this class. Needed for serialization. 056 */ 057 private static final long serialVersionUID = -824067898083969671L; 058 059 // Generate 2 attributes 060 private Point position; 061 062 /** 063 * 064 * @return this.position Point 065 */ 066 public Point getPosition() 067 { 068 return this.position; 069 } 070 071 /** 072 * 073 * @param positionIn Point 074 */ 075 public void setPosition(Point positionIn) 076 { 077 this.position = positionIn; 078 } 079 080 private Timestamp positionUpdateDate; 081 082 /** 083 * 084 * @return this.positionUpdateDate Timestamp 085 */ 086 public Timestamp getPositionUpdateDate() 087 { 088 return this.positionUpdateDate; 089 } 090 091 /** 092 * 093 * @param positionUpdateDateIn Timestamp 094 */ 095 public void setPositionUpdateDate(Timestamp positionUpdateDateIn) 096 { 097 this.positionUpdateDate = positionUpdateDateIn; 098 } 099 100 // Generate 0 associations 101 /** 102 * This entity does not have any identifiers 103 * but since it extends the <code>LocationImpl</code> class 104 * it will simply delegate the call up there. 105 * 106 * @see fr.ifremer.adagio.core.dao.referential.location.Location#equals(Object) 107 */ 108 @Override 109 public boolean equals(Object object) 110 { 111 return super.equals(object); 112 } 113 114 /** 115 * This entity does not have any identifiers 116 * but since it extends the <code>LocationImpl</code> class 117 * it will simply delegate the call up there. 118 * 119 * @see fr.ifremer.adagio.core.dao.referential.location.Location#hashCode() 120 */ 121 @Override 122 public int hashCode() 123 { 124 return super.hashCode(); 125 } 126 127 /** 128 * Constructs new instances of {@link LocationPoint}. 129 */ 130 public static final class Factory 131 { 132 /** 133 * Constructs a new instance of {@link LocationPoint}. 134 * @return new LocationPointImpl() 135 */ 136 public static LocationPoint newInstance() 137 { 138 return new LocationPointImpl(); 139 } 140 141 /** 142 * Constructs a new instance of {@link LocationPoint}, taking all required and/or 143 * read-only properties as arguments, except for identifiers. 144 * @param name String 145 * @param updateDate Timestamp 146 * @param validityStatus ValidityStatus 147 * @param locationClassification LocationClassification 148 * @param locationLevel LocationLevel 149 * @param status Status 150 * @param position Point 151 * @return newInstance 152 */ 153 public static LocationPoint newInstance(String name, Timestamp updateDate, ValidityStatus validityStatus, LocationClassification locationClassification, LocationLevel locationLevel, Status status, Point position) 154 { 155 final LocationPoint entity = new LocationPointImpl(); 156 entity.setName(name); 157 entity.setUpdateDate(updateDate); 158 entity.setValidityStatus(validityStatus); 159 entity.setLocationClassification(locationClassification); 160 entity.setLocationLevel(locationLevel); 161 entity.setStatus(status); 162 entity.setPosition(position); 163 return entity; 164 } 165 166 /** 167 * Constructs a new instance of {@link LocationPoint}, taking all possible properties 168 * (except the identifier(s))as arguments. 169 * @param label String 170 * @param name String 171 * @param bathymetry Float 172 * @param utFormat Short 173 * @param daylightSavingTime Boolean 174 * @param comments String 175 * @param updateDate Timestamp 176 * @param validityStatus ValidityStatus 177 * @param locationClassification LocationClassification 178 * @param locationLevel LocationLevel 179 * @param status Status 180 * @param position Point 181 * @param positionUpdateDate Timestamp 182 * @return newInstance LocationPoint 183 */ 184 public static LocationPoint newInstance(String label, String name, Float bathymetry, Short utFormat, Boolean daylightSavingTime, String comments, Timestamp updateDate, ValidityStatus validityStatus, LocationClassification locationClassification, LocationLevel locationLevel, Status status, Point position, Timestamp positionUpdateDate) 185 { 186 final LocationPoint entity = new LocationPointImpl(); 187 entity.setLabel(label); 188 entity.setName(name); 189 entity.setBathymetry(bathymetry); 190 entity.setUtFormat(utFormat); 191 entity.setDaylightSavingTime(daylightSavingTime); 192 entity.setComments(comments); 193 entity.setUpdateDate(updateDate); 194 entity.setValidityStatus(validityStatus); 195 entity.setLocationClassification(locationClassification); 196 entity.setLocationLevel(locationLevel); 197 entity.setStatus(status); 198 entity.setPosition(position); 199 entity.setPositionUpdateDate(positionUpdateDate); 200 return entity; 201 } 202 } 203 204 /** 205 * @see Comparable#compareTo 206 */ 207 public int compareTo(LocationPoint o) 208 { 209 int cmp = 0; 210 if (this.getId() != null) 211 { 212 cmp = this.getId().compareTo(o.getId()); 213 } 214 else 215 { 216 if (this.getPosition() != null) 217 { 218 cmp = (cmp != 0 ? cmp : this.getPosition().compareTo(o.getPosition())); 219 } 220 if (this.getPositionUpdateDate() != null) 221 { 222 cmp = (cmp != 0 ? cmp : this.getPositionUpdateDate().compareTo(o.getPositionUpdateDate())); 223 } 224 } 225 return cmp; 226 } 227// HibernateEntity.vsl merge-point 228// LocationPoint.java merge-point 229}