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.samplingScheme;
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.grouping.Grouping;
032import java.io.Serializable;
033
034/**
035 * Caractéristiques de la strate d'échantillonnage, en terme de regroupement d'entités.
036 * @since v3.2.0
037 */
038// HibernateEntity.vsl annotations merge-point
039public abstract class SamplingStrata2Grouping
040    implements Serializable, Comparable<SamplingStrata2Grouping>
041{
042    /**
043     * The serial version UID of this class. Needed for serialization.
044     */
045    private static final long serialVersionUID = -4042817968710955859L;
046
047    private SamplingStrata2GroupingPK samplingStrata2GroupingPk;
048
049    /**
050     * Get the composite primary key identifier class
051     * @return samplingStrata2GroupingPk
052     */
053    public SamplingStrata2GroupingPK getSamplingStrata2GroupingPk()
054    {
055        return this.samplingStrata2GroupingPk;
056    }
057
058    /**
059     * Set the composite primary key identifier class
060     * @param samplingStrata2GroupingPkIn
061     */
062    public void setSamplingStrata2GroupingPk(SamplingStrata2GroupingPK samplingStrata2GroupingPkIn) {
063        this.samplingStrata2GroupingPk = samplingStrata2GroupingPkIn;
064    }
065
066    // Generate 0 attributes
067    // Generate 2 associations
068    private SamplingStrata samplingStrata;
069
070    /**
071     * Représente une ligne du plan d'échantillonnage.
072     * @since v3.2.0
073     * @return this.samplingStrata SamplingStrata
074     */
075    public SamplingStrata getSamplingStrata()
076    {
077        return this.samplingStrata;
078    }
079
080    /**
081     * Représente une ligne du plan d'échantillonnage.
082     * @since v3.2.0
083     * @param samplingStrataIn SamplingStrata
084     */
085    public void setSamplingStrata(SamplingStrata samplingStrataIn)
086    {
087        this.samplingStrata = samplingStrataIn;
088    }
089
090    private Grouping grouping;
091
092    /**
093     * <html>
094     * <head>
095     * <style>
096     * p {padding:0px; margin:0px;}
097     * </style>
098     * </head>
099     * <body>
100     * <p>
101     * Un regroupement représente un groupement d'entités (du référentiel ou
102     * bien de navires), correspondant à un niveau de regroupement donné (<i>GroupingLevel</i>).
103     * </p>
104     * <p>
105     * </p>
106     * <p>
107     * Un regroupement peut faire référence à une ou plusieurs entités du
108     * référentiel (<i>GroupingItem</i>). Généralement, surtout les
109     * regroupements de plus bas niveau sont liés à des entités du référentiel
110     * (plus facile à maintenir), puis une table technique remplie toutes les
111     * associations possible avec les ancêtres (cf <i>GroupingItemHierarchy</i>).
112     * </p>
113     * <p>
114     * </p>
115     * <p>
116     * Un regroupement peut avoir un regroupement parent.
117     * </p>
118     * </body>
119     * </html>
120     * @return this.grouping Grouping
121     */
122    public Grouping getGrouping()
123    {
124        return this.grouping;
125    }
126
127    /**
128     * <html>
129     * <head>
130     * <style>
131     * p {padding:0px; margin:0px;}
132     * </style>
133     * </head>
134     * <body>
135     * <p>
136     * Un regroupement représente un groupement d'entités (du référentiel ou
137     * bien de navires), correspondant à un niveau de regroupement donné (<i>GroupingLevel</i>).
138     * </p>
139     * <p>
140     * </p>
141     * <p>
142     * Un regroupement peut faire référence à une ou plusieurs entités du
143     * référentiel (<i>GroupingItem</i>). Généralement, surtout les
144     * regroupements de plus bas niveau sont liés à des entités du référentiel
145     * (plus facile à maintenir), puis une table technique remplie toutes les
146     * associations possible avec les ancêtres (cf <i>GroupingItemHierarchy</i>).
147     * </p>
148     * <p>
149     * </p>
150     * <p>
151     * Un regroupement peut avoir un regroupement parent.
152     * </p>
153     * </body>
154     * </html>
155     * @param groupingIn Grouping
156     */
157    public void setGrouping(Grouping groupingIn)
158    {
159        this.grouping = groupingIn;
160    }
161
162    /**
163     * This entity does not have any identifiers
164     * and is not extending any other entity,
165     * so this method will only return <code>true</code> if the argument reference and <code>this</code>
166     * refer to the same object.
167     */
168    @Override
169    public boolean equals(Object object)
170    {
171        return super.equals(object);
172    }
173
174    /**
175     * This entity does not have any identifiers
176     * and is not extending any other entity,
177     * so this method will only take the identifiers of this entity into account when calculating the hash code.
178     */
179    @Override
180    public int hashCode()
181    {
182        return super.hashCode();
183    }
184
185    /**
186     * Constructs new instances of {@link SamplingStrata2Grouping}.
187     */
188    public static final class Factory
189    {
190        /**
191         * Constructs a new instance of {@link SamplingStrata2Grouping}.
192         * @return new SamplingStrata2GroupingImpl()
193         */
194        public static SamplingStrata2Grouping newInstance()
195        {
196            return new SamplingStrata2GroupingImpl();
197        }
198
199
200        /**
201         * Constructs a new instance of {@link SamplingStrata2Grouping}, taking all possible properties
202         * (except the identifier(s))as arguments.
203         * @param samplingStrata SamplingStrata
204         * @param grouping Grouping
205         * @return newInstance SamplingStrata2Grouping
206         */
207        public static SamplingStrata2Grouping newInstance(SamplingStrata samplingStrata, Grouping grouping)
208        {
209            final SamplingStrata2Grouping entity = new SamplingStrata2GroupingImpl();
210            entity.setSamplingStrata(samplingStrata);
211            entity.setGrouping(grouping);
212            return entity;
213        }
214    }
215
216    /**
217     * @see Comparable#compareTo
218     */
219    public int compareTo(SamplingStrata2Grouping o)
220    {
221        int cmp = 0;
222        if (this.getSamplingStrata2GroupingPk() != null)
223        {
224            cmp = this.getSamplingStrata2GroupingPk().compareTo(o.getSamplingStrata2GroupingPk());
225        }
226        return cmp;
227    }
228// HibernateEntity.vsl merge-point
229// SamplingStrata2Grouping.java merge-point
230}