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.conversion;
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.referential.pmfm.Unit;
032import java.io.Serializable;
033import java.sql.Timestamp;
034
035/**
036 * 
037 */
038// HibernateEntity.vsl annotations merge-point
039public abstract class UnitConversion
040    implements Serializable, Comparable<UnitConversion>
041{
042    /**
043     * The serial version UID of this class. Needed for serialization.
044     */
045    private static final long serialVersionUID = 833832694637284060L;
046
047    private UnitConversionPK unitConversionPk;
048
049    /**
050     * Get the composite primary key identifier class
051     * @return unitConversionPk
052     */
053    public UnitConversionPK getUnitConversionPk()
054    {
055        return this.unitConversionPk;
056    }
057
058    /**
059     * Set the composite primary key identifier class
060     * @param unitConversionPkIn
061     */
062    public void setUnitConversionPk(UnitConversionPK unitConversionPkIn) {
063        this.unitConversionPk = unitConversionPkIn;
064    }
065
066    // Generate 2 attributes
067    private Float conversionCoefficient;
068
069    /**
070     * 
071     * @return this.conversionCoefficient Float
072     */
073    public Float getConversionCoefficient()
074    {
075        return this.conversionCoefficient;
076    }
077
078    /**
079     * 
080     * @param conversionCoefficientIn Float
081     */
082    public void setConversionCoefficient(Float conversionCoefficientIn)
083    {
084        this.conversionCoefficient = conversionCoefficientIn;
085    }
086
087    private Timestamp updateDate;
088
089    /**
090     * 
091     * @return this.updateDate Timestamp
092     */
093    public Timestamp getUpdateDate()
094    {
095        return this.updateDate;
096    }
097
098    /**
099     * 
100     * @param updateDateIn Timestamp
101     */
102    public void setUpdateDate(Timestamp updateDateIn)
103    {
104        this.updateDate = updateDateIn;
105    }
106
107    // Generate 2 associations
108    private Unit fromUnit;
109
110    /**
111     * Unité d'une mesure.
112     * Nombre de lignes : 30
113     * @return this.fromUnit Unit
114     */
115    public Unit getFromUnit()
116    {
117        return this.fromUnit;
118    }
119
120    /**
121     * Unité d'une mesure.
122     * Nombre de lignes : 30
123     * @param fromUnitIn Unit
124     */
125    public void setFromUnit(Unit fromUnitIn)
126    {
127        this.fromUnit = fromUnitIn;
128    }
129
130    private Unit toUnit;
131
132    /**
133     * Unité d'une mesure.
134     * Nombre de lignes : 30
135     * @return this.toUnit Unit
136     */
137    public Unit getToUnit()
138    {
139        return this.toUnit;
140    }
141
142    /**
143     * Unité d'une mesure.
144     * Nombre de lignes : 30
145     * @param toUnitIn Unit
146     */
147    public void setToUnit(Unit toUnitIn)
148    {
149        this.toUnit = toUnitIn;
150    }
151
152    /**
153     * This entity does not have any identifiers
154     * and is not extending any other entity,
155     * so this method will only return <code>true</code> if the argument reference and <code>this</code>
156     * refer to the same object.
157     */
158    @Override
159    public boolean equals(Object object)
160    {
161        return super.equals(object);
162    }
163
164    /**
165     * This entity does not have any identifiers
166     * and is not extending any other entity,
167     * so this method will only take the identifiers of this entity into account when calculating the hash code.
168     */
169    @Override
170    public int hashCode()
171    {
172        return super.hashCode();
173    }
174
175    /**
176     * Constructs new instances of {@link UnitConversion}.
177     */
178    public static final class Factory
179    {
180        /**
181         * Constructs a new instance of {@link UnitConversion}.
182         * @return new UnitConversionImpl()
183         */
184        public static UnitConversion newInstance()
185        {
186            return new UnitConversionImpl();
187        }
188
189
190        /**
191         * Constructs a new instance of {@link UnitConversion}, taking all possible properties
192         * (except the identifier(s))as arguments.
193         * @param conversionCoefficient Float
194         * @param updateDate Timestamp
195         * @param fromUnit Unit
196         * @param toUnit Unit
197         * @return newInstance UnitConversion
198         */
199        public static UnitConversion newInstance(Float conversionCoefficient, Timestamp updateDate, Unit fromUnit, Unit toUnit)
200        {
201            final UnitConversion entity = new UnitConversionImpl();
202            entity.setConversionCoefficient(conversionCoefficient);
203            entity.setUpdateDate(updateDate);
204            entity.setFromUnit(fromUnit);
205            entity.setToUnit(toUnit);
206            return entity;
207        }
208    }
209
210    /**
211     * @see Comparable#compareTo
212     */
213    public int compareTo(UnitConversion o)
214    {
215        int cmp = 0;
216        if (this.getUnitConversionPk() != null)
217        {
218            cmp = this.getUnitConversionPk().compareTo(o.getUnitConversionPk());
219        }
220            if (this.getConversionCoefficient() != null)
221            {
222                cmp = (cmp != 0 ? cmp : this.getConversionCoefficient().compareTo(o.getConversionCoefficient()));
223            }
224            if (this.getUpdateDate() != null)
225            {
226                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
227            }
228        return cmp;
229    }
230// HibernateEntity.vsl merge-point
231// UnitConversion.java merge-point
232}