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 VirtualComponent
039    implements Serializable, Comparable<VirtualComponent>
040{
041    /**
042     * The serial version UID of this class. Needed for serialization.
043     */
044    private static final long serialVersionUID = 5324813425703303762L;
045
046    private VirtualComponentPK virtualComponentPk;
047
048    /**
049     * Get the composite primary key identifier class
050     * @return virtualComponentPk
051     */
052    public VirtualComponentPK getVirtualComponentPk()
053    {
054        return this.virtualComponentPk;
055    }
056
057    /**
058     * Set the composite primary key identifier class
059     * @param virtualComponentPkIn
060     */
061    public void setVirtualComponentPk(VirtualComponentPK virtualComponentPkIn) {
062        this.virtualComponentPk = virtualComponentPkIn;
063    }
064
065    // Generate 1 attributes
066    private Timestamp updateDate;
067
068    /**
069     * 
070     * @return this.updateDate Timestamp
071     */
072    public Timestamp getUpdateDate()
073    {
074        return this.updateDate;
075    }
076
077    /**
078     * 
079     * @param updateDateIn Timestamp
080     */
081    public void setUpdateDate(Timestamp updateDateIn)
082    {
083        this.updateDate = updateDateIn;
084    }
085
086    // Generate 2 associations
087    private ReferenceTaxon referenceTaxon;
088
089    /**
090     * 
091     * @return this.referenceTaxon ReferenceTaxon
092     */
093    public ReferenceTaxon getReferenceTaxon()
094    {
095        return this.referenceTaxon;
096    }
097
098    /**
099     * 
100     * @param referenceTaxonIn ReferenceTaxon
101     */
102    public void setReferenceTaxon(ReferenceTaxon referenceTaxonIn)
103    {
104        this.referenceTaxon = referenceTaxonIn;
105    }
106
107    private TaxonName taxonName;
108
109    /**
110     * Classe regroupant les taxons. Il s'agit en fait d'une combinaison entre un rang taxinomique,
111     * un nom
112     * de taxon, un code et éventuellement un auteur et une date.
113     * Cette classe regroupe les taxons valides, provisoires, obsolètes, virtuels et les synonymes.
114     * On garde l'historique du passage en taxon valide, puis du passage en synonyme (date de fin
115     * référent).
116     * Dans COST : "Use the FAO reference list ftp://ftp.fao.org/FI/stat/data/ASFIS_sp.zip"
117     * @return this.taxonName TaxonName
118     */
119    public TaxonName getTaxonName()
120    {
121        return this.taxonName;
122    }
123
124    /**
125     * Classe regroupant les taxons. Il s'agit en fait d'une combinaison entre un rang taxinomique,
126     * un nom
127     * de taxon, un code et éventuellement un auteur et une date.
128     * Cette classe regroupe les taxons valides, provisoires, obsolètes, virtuels et les synonymes.
129     * On garde l'historique du passage en taxon valide, puis du passage en synonyme (date de fin
130     * référent).
131     * Dans COST : "Use the FAO reference list ftp://ftp.fao.org/FI/stat/data/ASFIS_sp.zip"
132     * @param taxonNameIn TaxonName
133     */
134    public void setTaxonName(TaxonName taxonNameIn)
135    {
136        this.taxonName = taxonNameIn;
137    }
138
139    /**
140     * This entity does not have any identifiers
141     * and is not extending any other entity,
142     * so this method will only return <code>true</code> if the argument reference and <code>this</code>
143     * refer to the same object.
144     */
145    @Override
146    public boolean equals(Object object)
147    {
148        return super.equals(object);
149    }
150
151    /**
152     * This entity does not have any identifiers
153     * and is not extending any other entity,
154     * so this method will only take the identifiers of this entity into account when calculating the hash code.
155     */
156    @Override
157    public int hashCode()
158    {
159        return super.hashCode();
160    }
161
162    /**
163     * Constructs new instances of {@link VirtualComponent}.
164     */
165    public static final class Factory
166    {
167        /**
168         * Constructs a new instance of {@link VirtualComponent}.
169         * @return new VirtualComponentImpl()
170         */
171        public static VirtualComponent newInstance()
172        {
173            return new VirtualComponentImpl();
174        }
175
176
177        /**
178         * Constructs a new instance of {@link VirtualComponent}, taking all possible properties
179         * (except the identifier(s))as arguments.
180         * @param updateDate Timestamp
181         * @param referenceTaxon ReferenceTaxon
182         * @param taxonName TaxonName
183         * @return newInstance VirtualComponent
184         */
185        public static VirtualComponent newInstance(Timestamp updateDate, ReferenceTaxon referenceTaxon, TaxonName taxonName)
186        {
187            final VirtualComponent entity = new VirtualComponentImpl();
188            entity.setUpdateDate(updateDate);
189            entity.setReferenceTaxon(referenceTaxon);
190            entity.setTaxonName(taxonName);
191            return entity;
192        }
193    }
194
195    /**
196     * @see Comparable#compareTo
197     */
198    public int compareTo(VirtualComponent o)
199    {
200        int cmp = 0;
201        if (this.getVirtualComponentPk() != null)
202        {
203            cmp = this.getVirtualComponentPk().compareTo(o.getVirtualComponentPk());
204        }
205            if (this.getUpdateDate() != null)
206            {
207                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
208            }
209        return cmp;
210    }
211// HibernateEntity.vsl merge-point
212// VirtualComponent.java merge-point
213}