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.spatial;
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.location.Location;
032import java.io.Serializable;
033
034/**
035 * 
036 */
037// HibernateEntity.vsl annotations merge-point
038public abstract class SpatialItem2Location
039    implements Serializable, Comparable<SpatialItem2Location>
040{
041    /**
042     * The serial version UID of this class. Needed for serialization.
043     */
044    private static final long serialVersionUID = -5434631978329215648L;
045
046    private SpatialItem2LocationPK spatialItem2LocationPk;
047
048    /**
049     * Get the composite primary key identifier class
050     * @return spatialItem2LocationPk
051     */
052    public SpatialItem2LocationPK getSpatialItem2LocationPk()
053    {
054        return this.spatialItem2LocationPk;
055    }
056
057    /**
058     * Set the composite primary key identifier class
059     * @param spatialItem2LocationPkIn
060     */
061    public void setSpatialItem2LocationPk(SpatialItem2LocationPK spatialItem2LocationPkIn) {
062        this.spatialItem2LocationPk = spatialItem2LocationPkIn;
063    }
064
065    // Generate 1 attributes
066    private String localizedName;
067
068    /**
069     * 
070     * @return this.localizedName String
071     */
072    public String getLocalizedName()
073    {
074        return this.localizedName;
075    }
076
077    /**
078     * 
079     * @param localizedNameIn String
080     */
081    public void setLocalizedName(String localizedNameIn)
082    {
083        this.localizedName = localizedNameIn;
084    }
085
086    // Generate 2 associations
087    private Location location;
088
089    /**
090     * Représente un lieu au sens général du terme. Il peut s'agir d'un lieu ponctuel, linéaire ou
091     * surfacique.
092     * Suivant sa classification et son niveau, il peut s'agir d'un secteur FAO, un port de pêche,
093     * un
094     * quartier maritime, une criée, etc.
095     * Nombre de lignes : lieux terrestre : 4500 + secteurs : 11210 + strates : 1000 + localités :
096     * 200
097     * @return this.location Location
098     */
099    public Location getLocation()
100    {
101        return this.location;
102    }
103
104    /**
105     * Représente un lieu au sens général du terme. Il peut s'agir d'un lieu ponctuel, linéaire ou
106     * surfacique.
107     * Suivant sa classification et son niveau, il peut s'agir d'un secteur FAO, un port de pêche,
108     * un
109     * quartier maritime, une criée, etc.
110     * Nombre de lignes : lieux terrestre : 4500 + secteurs : 11210 + strates : 1000 + localités :
111     * 200
112     * @param locationIn Location
113     */
114    public void setLocation(Location locationIn)
115    {
116        this.location = locationIn;
117    }
118
119    private SpatialItem spatialItem;
120
121    /**
122     * Présence d'un élément d'une liste du référentiel sur une ou plusieurs zones géographiques.
123     * Une ou plusieurs géométrie (ponctuelle, linéraire ou polygonale) peuvent etre définies afin
124     * de
125     * géolocaliser un des éléments d'une liste.
126     * Une procédure stockée sous Oracle permet la mise à jour d'un lien vers le référentiel des
127     * lieux
128     * (table SPATIAL_ITEM2LOCATION) à partir des géométries définies.
129     * @return this.spatialItem SpatialItem
130     */
131    public SpatialItem getSpatialItem()
132    {
133        return this.spatialItem;
134    }
135
136    /**
137     * Présence d'un élément d'une liste du référentiel sur une ou plusieurs zones géographiques.
138     * Une ou plusieurs géométrie (ponctuelle, linéraire ou polygonale) peuvent etre définies afin
139     * de
140     * géolocaliser un des éléments d'une liste.
141     * Une procédure stockée sous Oracle permet la mise à jour d'un lien vers le référentiel des
142     * lieux
143     * (table SPATIAL_ITEM2LOCATION) à partir des géométries définies.
144     * @param spatialItemIn SpatialItem
145     */
146    public void setSpatialItem(SpatialItem spatialItemIn)
147    {
148        this.spatialItem = spatialItemIn;
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 return <code>true</code> if the argument reference and <code>this</code>
155     * refer to the same object.
156     */
157    @Override
158    public boolean equals(Object object)
159    {
160        return super.equals(object);
161    }
162
163    /**
164     * This entity does not have any identifiers
165     * and is not extending any other entity,
166     * so this method will only take the identifiers of this entity into account when calculating the hash code.
167     */
168    @Override
169    public int hashCode()
170    {
171        return super.hashCode();
172    }
173
174    /**
175     * Constructs new instances of {@link SpatialItem2Location}.
176     */
177    public static final class Factory
178    {
179        /**
180         * Constructs a new instance of {@link SpatialItem2Location}.
181         * @return new SpatialItem2LocationImpl()
182         */
183        public static SpatialItem2Location newInstance()
184        {
185            return new SpatialItem2LocationImpl();
186        }
187
188        /**
189         * Constructs a new instance of {@link SpatialItem2Location}, taking all required and/or
190         * read-only properties as arguments, except for identifiers.
191         * @param location Location
192         * @param spatialItem SpatialItem
193         * @return newInstance
194         */
195        public static SpatialItem2Location newInstance(Location location, SpatialItem spatialItem)
196        {
197            final SpatialItem2Location entity = new SpatialItem2LocationImpl();
198            entity.setLocation(location);
199            entity.setSpatialItem(spatialItem);
200            return entity;
201        }
202
203        /**
204         * Constructs a new instance of {@link SpatialItem2Location}, taking all possible properties
205         * (except the identifier(s))as arguments.
206         * @param localizedName String
207         * @param location Location
208         * @param spatialItem SpatialItem
209         * @return newInstance SpatialItem2Location
210         */
211        public static SpatialItem2Location newInstance(String localizedName, Location location, SpatialItem spatialItem)
212        {
213            final SpatialItem2Location entity = new SpatialItem2LocationImpl();
214            entity.setLocalizedName(localizedName);
215            entity.setLocation(location);
216            entity.setSpatialItem(spatialItem);
217            return entity;
218        }
219    }
220
221    /**
222     * @see Comparable#compareTo
223     */
224    public int compareTo(SpatialItem2Location o)
225    {
226        int cmp = 0;
227        if (this.getSpatialItem2LocationPk() != null)
228        {
229            cmp = this.getSpatialItem2LocationPk().compareTo(o.getSpatialItem2LocationPk());
230        }
231            if (this.getLocalizedName() != null)
232            {
233                cmp = (cmp != 0 ? cmp : this.getLocalizedName().compareTo(o.getLocalizedName()));
234            }
235        return cmp;
236    }
237// HibernateEntity.vsl merge-point
238// SpatialItem2Location.java merge-point
239}