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.fishingArea;
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 * Table de liaison entre une zone de peche effective, et une zone avec une réglementation
036 * particulière (ex : ZEE, zone d'effort, etc.).
037 * Cela permet de lister, pour une zone de peche effective, dans quelles réglementaires se trouve le
038 * navire.
039 * Utilisé dans SACAPT.
040 * Dans le cas particulier des campagnes scientifique, cette table permet d'associé au rectangle ou
041 * sous-rectangle de la zone de pêche, une localité, une strate, ou les deux, suivant ce qui a été
042 * défini dans le protocole de collecte.
043 */
044// HibernateEntity.vsl annotations merge-point
045public abstract class FishingArea2RegulationLocation
046    implements Serializable, Comparable<FishingArea2RegulationLocation>
047{
048    /**
049     * The serial version UID of this class. Needed for serialization.
050     */
051    private static final long serialVersionUID = -1355821668296372110L;
052
053    private FishingArea2RegulationLocationPK fishingArea2RegulationLocationPk;
054
055    /**
056     * Get the composite primary key identifier class
057     * @return fishingArea2RegulationLocationPk
058     */
059    public FishingArea2RegulationLocationPK getFishingArea2RegulationLocationPk()
060    {
061        return this.fishingArea2RegulationLocationPk;
062    }
063
064    /**
065     * Set the composite primary key identifier class
066     * @param fishingArea2RegulationLocationPkIn
067     */
068    public void setFishingArea2RegulationLocationPk(FishingArea2RegulationLocationPK fishingArea2RegulationLocationPkIn) {
069        this.fishingArea2RegulationLocationPk = fishingArea2RegulationLocationPkIn;
070    }
071
072    // Generate 0 attributes
073    // Generate 2 associations
074    private FishingArea fishingArea;
075
076    /**
077     * Une zone de peche effective
078     * @return this.fishingArea FishingArea
079     */
080    public FishingArea getFishingArea()
081    {
082        return this.fishingArea;
083    }
084
085    /**
086     * Une zone de peche effective
087     * @param fishingAreaIn FishingArea
088     */
089    public void setFishingArea(FishingArea fishingAreaIn)
090    {
091        this.fishingArea = fishingAreaIn;
092    }
093
094    private Location location;
095
096    /**
097     * Zone réglementaire particulière (ex : ZEE, zone d'effort, etc.)
098     * @return this.location Location
099     */
100    public Location getLocation()
101    {
102        return this.location;
103    }
104
105    /**
106     * Zone réglementaire particulière (ex : ZEE, zone d'effort, etc.)
107     * @param locationIn Location
108     */
109    public void setLocation(Location locationIn)
110    {
111        this.location = locationIn;
112    }
113
114    /**
115     * This entity does not have any identifiers
116     * and is not extending any other entity,
117     * so this method will only return <code>true</code> if the argument reference and <code>this</code>
118     * refer to the same object.
119     */
120    @Override
121    public boolean equals(Object object)
122    {
123        return super.equals(object);
124    }
125
126    /**
127     * This entity does not have any identifiers
128     * and is not extending any other entity,
129     * so this method will only take the identifiers of this entity into account when calculating the hash code.
130     */
131    @Override
132    public int hashCode()
133    {
134        return super.hashCode();
135    }
136
137    /**
138     * Constructs new instances of {@link FishingArea2RegulationLocation}.
139     */
140    public static final class Factory
141    {
142        /**
143         * Constructs a new instance of {@link FishingArea2RegulationLocation}.
144         * @return new FishingArea2RegulationLocationImpl()
145         */
146        public static FishingArea2RegulationLocation newInstance()
147        {
148            return new FishingArea2RegulationLocationImpl();
149        }
150
151
152        /**
153         * Constructs a new instance of {@link FishingArea2RegulationLocation}, taking all possible properties
154         * (except the identifier(s))as arguments.
155         * @param fishingArea FishingArea
156         * @param location Location
157         * @return newInstance FishingArea2RegulationLocation
158         */
159        public static FishingArea2RegulationLocation newInstance(FishingArea fishingArea, Location location)
160        {
161            final FishingArea2RegulationLocation entity = new FishingArea2RegulationLocationImpl();
162            entity.setFishingArea(fishingArea);
163            entity.setLocation(location);
164            return entity;
165        }
166    }
167
168    /**
169     * @see Comparable#compareTo
170     */
171    public int compareTo(FishingArea2RegulationLocation o)
172    {
173        int cmp = 0;
174        if (this.getFishingArea2RegulationLocationPk() != null)
175        {
176            cmp = this.getFishingArea2RegulationLocationPk().compareTo(o.getFishingArea2RegulationLocationPk());
177        }
178        return cmp;
179    }
180// HibernateEntity.vsl merge-point
181// FishingArea2RegulationLocation.java merge-point
182}