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.playground; 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; 032 033/** 034 * Espèce commerciales avec détails spécifique pour la vente en criée. 035 * ref : flux RIC II 036 * TODO : voir dans quelle mesure il est possible d'utiliser TaxonGroup à la place de cette classe 037 * (avec un TaxonGroupType particulier = 'Espèce commerciale RIC II') 038 */ 039// HibernateEntity.vsl annotations merge-point 040public abstract class PlaygroundRicTaxonGroup 041 implements Serializable, Comparable<PlaygroundRicTaxonGroup> 042{ 043 /** 044 * The serial version UID of this class. Needed for serialization. 045 */ 046 private static final long serialVersionUID = -2141805059312116616L; 047 048 // Generate 2 attributes 049 private String code; 050 051 /** 052 * Code de l'espèce RIC 053 * @return this.code String 054 */ 055 public String getCode() 056 { 057 return this.code; 058 } 059 060 /** 061 * Code de l'espèce RIC 062 * @param codeIn String 063 */ 064 public void setCode(String codeIn) 065 { 066 this.code = codeIn; 067 } 068 069 private String name; 070 071 /** 072 * 073 * @return this.name String 074 */ 075 public String getName() 076 { 077 return this.name; 078 } 079 080 /** 081 * 082 * @param nameIn String 083 */ 084 public void setName(String nameIn) 085 { 086 this.name = nameIn; 087 } 088 089 // Generate 0 associations 090 /** 091 * Returns <code>true</code> if the argument is an PlaygroundRicTaxonGroup instance and all identifiers for this entity 092 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 093 */ 094 @Override 095 public boolean equals(Object object) 096 { 097 if (this == object) 098 { 099 return true; 100 } 101 if (!(object instanceof PlaygroundRicTaxonGroup)) 102 { 103 return false; 104 } 105 final PlaygroundRicTaxonGroup that = (PlaygroundRicTaxonGroup)object; 106 if (this.code == null || that.getCode() == null || !this.code.equals(that.getCode())) 107 { 108 return false; 109 } 110 return true; 111 } 112 113 /** 114 * Returns a hash code based on this entity's identifiers. 115 */ 116 @Override 117 public int hashCode() 118 { 119 int hashCode = 0; 120 hashCode = 29 * hashCode + (this.code == null ? 0 : this.code.hashCode()); 121 122 return hashCode; 123 } 124 125 /** 126 * Constructs new instances of {@link PlaygroundRicTaxonGroup}. 127 */ 128 public static final class Factory 129 { 130 /** 131 * Constructs a new instance of {@link PlaygroundRicTaxonGroup}. 132 * @return new PlaygroundRicTaxonGroupImpl() 133 */ 134 public static PlaygroundRicTaxonGroup newInstance() 135 { 136 return new PlaygroundRicTaxonGroupImpl(); 137 } 138 139 140 /** 141 * Constructs a new instance of {@link PlaygroundRicTaxonGroup}, taking all possible properties 142 * (except the identifier(s))as arguments. 143 * @param name String 144 * @return newInstance PlaygroundRicTaxonGroup 145 */ 146 public static PlaygroundRicTaxonGroup newInstance(String name) 147 { 148 final PlaygroundRicTaxonGroup entity = new PlaygroundRicTaxonGroupImpl(); 149 entity.setName(name); 150 return entity; 151 } 152 } 153 154 /** 155 * @see Comparable#compareTo 156 */ 157 public int compareTo(PlaygroundRicTaxonGroup o) 158 { 159 int cmp = 0; 160 if (this.getCode() != null) 161 { 162 cmp = this.getCode().compareTo(o.getCode()); 163 } 164 else 165 { 166 if (this.getName() != null) 167 { 168 cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName())); 169 } 170 } 171 return cmp; 172 } 173// HibernateEntity.vsl merge-point 174// PlaygroundRicTaxonGroup.java merge-point 175}