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.taxon; 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 java.io.Serializable; 032import java.sql.Timestamp; 033 034/** 035 * 036 */ 037// HibernateEntity.vsl annotations merge-point 038public abstract class ReferenceTaxon 039 implements Serializable, Comparable<ReferenceTaxon> 040{ 041 /** 042 * The serial version UID of this class. Needed for serialization. 043 */ 044 private static final long serialVersionUID = 922202299998876456L; 045 046 // Generate 3 attributes 047 private Integer id; 048 049 /** 050 * Cet identifiant unique est porté par les libellés valides et non par les synonymes.La 051 * modification d'un libellé n'entraîne pas de changement de cet identifiant.C’est le code 052 * unique et définitif de l’entité référencée. Le code permanent est le marqueur spécifique de 053 * l’entité qui est conservé en cas de changement de dénomination de celle-ci ; il n’est jamais 054 * réattribué en cas de disparition de l’entité (le code disparaît avec elle).Le code permanent 055 * est non-intelligent, c’est-à-dire qu’il n’intègre aucune autre information que 056 * l’identification univoque et non-ambiguë de l’entité. 057 * @return this.id Integer 058 */ 059 public Integer getId() 060 { 061 return this.id; 062 } 063 064 /** 065 * Cet identifiant unique est porté par les libellés valides et non par les synonymes.La 066 * modification d'un libellé n'entraîne pas de changement de cet identifiant.C’est le code 067 * unique et définitif de l’entité référencée. Le code permanent est le marqueur spécifique de 068 * l’entité qui est conservé en cas de changement de dénomination de celle-ci ; il n’est jamais 069 * réattribué en cas de disparition de l’entité (le code disparaît avec elle).Le code permanent 070 * est non-intelligent, c’est-à-dire qu’il n’intègre aucune autre information que 071 * l’identification univoque et non-ambiguë de l’entité. 072 * @param idIn Integer 073 */ 074 public void setId(Integer idIn) 075 { 076 this.id = idIn; 077 } 078 079 private Timestamp updateDate; 080 081 /** 082 * 083 * @return this.updateDate Timestamp 084 */ 085 public Timestamp getUpdateDate() 086 { 087 return this.updateDate; 088 } 089 090 /** 091 * 092 * @param updateDateIn Timestamp 093 */ 094 public void setUpdateDate(Timestamp updateDateIn) 095 { 096 this.updateDate = updateDateIn; 097 } 098 099 private String name; 100 101 /** 102 * 103 * @return this.name String 104 */ 105 public String getName() 106 { 107 return this.name; 108 } 109 110 /** 111 * 112 * @param nameIn String 113 */ 114 public void setName(String nameIn) 115 { 116 this.name = nameIn; 117 } 118 119 // Generate 14 associations 120 /** 121 * Returns <code>true</code> if the argument is an ReferenceTaxon instance and all identifiers for this entity 122 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 123 */ 124 @Override 125 public boolean equals(Object object) 126 { 127 if (this == object) 128 { 129 return true; 130 } 131 if (!(object instanceof ReferenceTaxon)) 132 { 133 return false; 134 } 135 final ReferenceTaxon that = (ReferenceTaxon)object; 136 if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) 137 { 138 return false; 139 } 140 return true; 141 } 142 143 /** 144 * Returns a hash code based on this entity's identifiers. 145 */ 146 @Override 147 public int hashCode() 148 { 149 int hashCode = 0; 150 hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode()); 151 152 return hashCode; 153 } 154 155 /** 156 * Constructs new instances of {@link ReferenceTaxon}. 157 */ 158 public static final class Factory 159 { 160 /** 161 * Constructs a new instance of {@link ReferenceTaxon}. 162 * @return new ReferenceTaxonImpl() 163 */ 164 public static ReferenceTaxon newInstance() 165 { 166 return new ReferenceTaxonImpl(); 167 } 168 169 /** 170 * Constructs a new instance of {@link ReferenceTaxon}, taking all required and/or 171 * read-only properties as arguments, except for identifiers. 172 * @param updateDate Timestamp 173 * @return newInstance 174 */ 175 public static ReferenceTaxon newInstance(Timestamp updateDate) 176 { 177 final ReferenceTaxon entity = new ReferenceTaxonImpl(); 178 entity.setUpdateDate(updateDate); 179 return entity; 180 } 181 182 /** 183 * Constructs a new instance of {@link ReferenceTaxon}, taking all possible properties 184 * (except the identifier(s))as arguments. 185 * @param updateDate Timestamp 186 * @param name String 187 * @return newInstance ReferenceTaxon 188 */ 189 public static ReferenceTaxon newInstance(Timestamp updateDate, String name) 190 { 191 final ReferenceTaxon entity = new ReferenceTaxonImpl(); 192 entity.setUpdateDate(updateDate); 193 entity.setName(name); 194 return entity; 195 } 196 } 197 198 /** 199 * @see Comparable#compareTo 200 */ 201 public int compareTo(ReferenceTaxon o) 202 { 203 int cmp = 0; 204 if (this.getId() != null) 205 { 206 cmp = this.getId().compareTo(o.getId()); 207 } 208 else 209 { 210 if (this.getUpdateDate() != null) 211 { 212 cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate())); 213 } 214 if (this.getName() != null) 215 { 216 cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName())); 217 } 218 } 219 return cmp; 220 } 221// HibernateEntity.vsl merge-point 222// ReferenceTaxon.java merge-point 223}