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.data.operation; 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 fr.ifremer.adagio.core.dao.data.vessel.Vessel; 032import java.io.Serializable; 033 034/** 035 * Informations permet de décrire, par exemple la stratégie de répartition entre le navire observé 036 * et le navire associé pour l'opération. 037 * En effet, des navires travaillent en paires (ou en bœufs), par exemple pour tirer à deux un meme 038 * chalut. 039 * note : Il peut s'agir d'un navire temporaire. 040 */ 041// HibernateEntity.vsl annotations merge-point 042public abstract class OperationVesselAssociation 043 implements Serializable, Comparable<OperationVesselAssociation> 044{ 045 /** 046 * The serial version UID of this class. Needed for serialization. 047 */ 048 private static final long serialVersionUID = -1665621571136924914L; 049 050 private OperationVesselAssociationPK operationVesselAssociationPk; 051 052 /** 053 * Get the composite primary key identifier class 054 * @return operationVesselAssociationPk 055 */ 056 public OperationVesselAssociationPK getOperationVesselAssociationPk() 057 { 058 return this.operationVesselAssociationPk; 059 } 060 061 /** 062 * Set the composite primary key identifier class 063 * @param operationVesselAssociationPkIn 064 */ 065 public void setOperationVesselAssociationPk(OperationVesselAssociationPK operationVesselAssociationPkIn) { 066 this.operationVesselAssociationPk = operationVesselAssociationPkIn; 067 } 068 069 // Generate 2 attributes 070 private Boolean isCatchOnOperationVessel; 071 072 /** 073 * La capture est elle à bord du navire observé ? 074 * @return this.isCatchOnOperationVessel Boolean 075 */ 076 public Boolean isIsCatchOnOperationVessel() 077 { 078 return this.isCatchOnOperationVessel; 079 } 080 081 /** 082 * La capture est elle à bord du navire observé ? 083 * @param isCatchOnOperationVesselIn Boolean 084 */ 085 public void setIsCatchOnOperationVessel(Boolean isCatchOnOperationVesselIn) 086 { 087 this.isCatchOnOperationVessel = isCatchOnOperationVesselIn; 088 } 089 090 private String comments; 091 092 /** 093 * Commentaire sur la nature de l'association avec le navire (optionnel). 094 * @return this.comments String 095 */ 096 public String getComments() 097 { 098 return this.comments; 099 } 100 101 /** 102 * Commentaire sur la nature de l'association avec le navire (optionnel). 103 * @param commentsIn String 104 */ 105 public void setComments(String commentsIn) 106 { 107 this.comments = commentsIn; 108 } 109 110 // Generate 2 associations 111 private Vessel vessel; 112 113 /** 114 * Navire, ou plus généralement un usager de la ressource. 115 * Peut etre un navire de peche professionnel ou non, un navire scientifique, un pêcheur à pied, 116 * un 117 * groupement de navires, etc. 118 * @return this.vessel Vessel 119 */ 120 public Vessel getVessel() 121 { 122 return this.vessel; 123 } 124 125 /** 126 * Navire, ou plus généralement un usager de la ressource. 127 * Peut etre un navire de peche professionnel ou non, un navire scientifique, un pêcheur à pied, 128 * un 129 * groupement de navires, etc. 130 * @param vesselIn Vessel 131 */ 132 public void setVessel(Vessel vesselIn) 133 { 134 this.vessel = vesselIn; 135 } 136 137 private Operation operation; 138 139 /** 140 * Opération éffectuée dans le cadre d'une marée (observée en mer, observée au débarquement, 141 * campagne 142 * en mer, marée déclarée, etc.). 143 * Une opération peut etre une opération de peche ou non. Par exemple, au cours de campagne à la 144 * mer, 145 * le navire peut déployer des engins de collecte de données environnementales (température, 146 * salinité, 147 * etc. ). 148 * @return this.operation Operation 149 */ 150 public Operation getOperation() 151 { 152 return this.operation; 153 } 154 155 /** 156 * Opération éffectuée dans le cadre d'une marée (observée en mer, observée au débarquement, 157 * campagne 158 * en mer, marée déclarée, etc.). 159 * Une opération peut etre une opération de peche ou non. Par exemple, au cours de campagne à la 160 * mer, 161 * le navire peut déployer des engins de collecte de données environnementales (température, 162 * salinité, 163 * etc. ). 164 * @param operationIn Operation 165 */ 166 public void setOperation(Operation operationIn) 167 { 168 this.operation = operationIn; 169 } 170 171 /** 172 * This entity does not have any identifiers 173 * and is not extending any other entity, 174 * so this method will only return <code>true</code> if the argument reference and <code>this</code> 175 * refer to the same object. 176 */ 177 @Override 178 public boolean equals(Object object) 179 { 180 return super.equals(object); 181 } 182 183 /** 184 * This entity does not have any identifiers 185 * and is not extending any other entity, 186 * so this method will only take the identifiers of this entity into account when calculating the hash code. 187 */ 188 @Override 189 public int hashCode() 190 { 191 return super.hashCode(); 192 } 193 194 /** 195 * Constructs new instances of {@link OperationVesselAssociation}. 196 */ 197 public static final class Factory 198 { 199 /** 200 * Constructs a new instance of {@link OperationVesselAssociation}. 201 * @return new OperationVesselAssociationImpl() 202 */ 203 public static OperationVesselAssociation newInstance() 204 { 205 return new OperationVesselAssociationImpl(); 206 } 207 208 /** 209 * Constructs a new instance of {@link OperationVesselAssociation}, taking all required and/or 210 * read-only properties as arguments, except for identifiers. 211 * @param isCatchOnOperationVessel Boolean 212 * @param vessel Vessel 213 * @param operation Operation 214 * @return newInstance 215 */ 216 public static OperationVesselAssociation newInstance(Boolean isCatchOnOperationVessel, Vessel vessel, Operation operation) 217 { 218 final OperationVesselAssociation entity = new OperationVesselAssociationImpl(); 219 entity.setIsCatchOnOperationVessel(isCatchOnOperationVessel); 220 entity.setVessel(vessel); 221 entity.setOperation(operation); 222 return entity; 223 } 224 225 /** 226 * Constructs a new instance of {@link OperationVesselAssociation}, taking all possible properties 227 * (except the identifier(s))as arguments. 228 * @param isCatchOnOperationVessel Boolean 229 * @param comments String 230 * @param vessel Vessel 231 * @param operation Operation 232 * @return newInstance OperationVesselAssociation 233 */ 234 public static OperationVesselAssociation newInstance(Boolean isCatchOnOperationVessel, String comments, Vessel vessel, Operation operation) 235 { 236 final OperationVesselAssociation entity = new OperationVesselAssociationImpl(); 237 entity.setIsCatchOnOperationVessel(isCatchOnOperationVessel); 238 entity.setComments(comments); 239 entity.setVessel(vessel); 240 entity.setOperation(operation); 241 return entity; 242 } 243 } 244 245 /** 246 * @see Comparable#compareTo 247 */ 248 public int compareTo(OperationVesselAssociation o) 249 { 250 int cmp = 0; 251 if (this.getOperationVesselAssociationPk() != null) 252 { 253 cmp = this.getOperationVesselAssociationPk().compareTo(o.getOperationVesselAssociationPk()); 254 } 255 if (this.isIsCatchOnOperationVessel() != null) 256 { 257 cmp = (cmp != 0 ? cmp : this.isIsCatchOnOperationVessel().compareTo(o.isIsCatchOnOperationVessel())); 258 } 259 if (this.getComments() != null) 260 { 261 cmp = (cmp != 0 ? cmp : this.getComments().compareTo(o.getComments())); 262 } 263 return cmp; 264 } 265// HibernateEntity.vsl merge-point 266// OperationVesselAssociation.java merge-point 267}