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.location;
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 com.vividsolutions.jts.geom.MultiLineString;
032import fr.ifremer.adagio.core.dao.referential.Status;
033import fr.ifremer.adagio.core.dao.referential.ValidityStatus;
034import java.sql.Timestamp;
035
036/**
037 * Géomtérie multi-lignes (polygone ouvert) associée au lieu.
038 * A utiliser uniquement pour les lieux ayant une géométrie multi-ligne : n'avoir qu'un seul type de
039 * géométrie dans une table permet d'optimiser les index spatiaux d'Oracle, utilisés pour les
040 * requêtes spatiales.
041 */
042// HibernateEntity.vsl annotations merge-point
043public abstract class LocationLine
044    extends LocationImpl
045{
046    /**
047     * The serial version UID of this class. Needed for serialization.
048     */
049    private static final long serialVersionUID = -9076911748660088315L;
050
051    // Generate 2 attributes
052    private MultiLineString position;
053
054    /**
055     * 
056     * @return this.position MultiLineString
057     */
058    public MultiLineString getPosition()
059    {
060        return this.position;
061    }
062
063    /**
064     * 
065     * @param positionIn MultiLineString
066     */
067    public void setPosition(MultiLineString positionIn)
068    {
069        this.position = positionIn;
070    }
071
072    private Timestamp positionUpdateDate;
073
074    /**
075     * 
076     * @return this.positionUpdateDate Timestamp
077     */
078    public Timestamp getPositionUpdateDate()
079    {
080        return this.positionUpdateDate;
081    }
082
083    /**
084     * 
085     * @param positionUpdateDateIn Timestamp
086     */
087    public void setPositionUpdateDate(Timestamp positionUpdateDateIn)
088    {
089        this.positionUpdateDate = positionUpdateDateIn;
090    }
091
092    // Generate 0 associations
093    /**
094     * This entity does not have any identifiers
095     * but since it extends the <code>LocationImpl</code> class
096     * it will simply delegate the call up there.
097     *
098     * @see fr.ifremer.adagio.core.dao.referential.location.Location#equals(Object)
099     */
100    @Override
101    public boolean equals(Object object)
102    {
103        return super.equals(object);
104    }
105
106    /**
107     * This entity does not have any identifiers
108     * but since it extends the <code>LocationImpl</code> class
109     * it will simply delegate the call up there.
110     *
111     * @see fr.ifremer.adagio.core.dao.referential.location.Location#hashCode()
112     */
113    @Override
114    public int hashCode()
115    {
116        return super.hashCode();
117    }
118
119    /**
120     * Constructs new instances of {@link LocationLine}.
121     */
122    public static final class Factory
123    {
124        /**
125         * Constructs a new instance of {@link LocationLine}.
126         * @return new LocationLineImpl()
127         */
128        public static LocationLine newInstance()
129        {
130            return new LocationLineImpl();
131        }
132
133        /**
134         * Constructs a new instance of {@link LocationLine}, taking all required and/or
135         * read-only properties as arguments, except for identifiers.
136         * @param name String
137         * @param updateDate Timestamp
138         * @param validityStatus ValidityStatus
139         * @param locationClassification LocationClassification
140         * @param locationLevel LocationLevel
141         * @param status Status
142         * @param position MultiLineString
143         * @return newInstance
144         */
145        public static LocationLine newInstance(String name, Timestamp updateDate, ValidityStatus validityStatus, LocationClassification locationClassification, LocationLevel locationLevel, Status status, MultiLineString position)
146        {
147            final LocationLine entity = new LocationLineImpl();
148            entity.setName(name);
149            entity.setUpdateDate(updateDate);
150            entity.setValidityStatus(validityStatus);
151            entity.setLocationClassification(locationClassification);
152            entity.setLocationLevel(locationLevel);
153            entity.setStatus(status);
154            entity.setPosition(position);
155            return entity;
156        }
157
158        /**
159         * Constructs a new instance of {@link LocationLine}, taking all possible properties
160         * (except the identifier(s))as arguments.
161         * @param label String
162         * @param name String
163         * @param bathymetry Float
164         * @param utFormat Short
165         * @param daylightSavingTime Boolean
166         * @param comments String
167         * @param updateDate Timestamp
168         * @param validityStatus ValidityStatus
169         * @param locationClassification LocationClassification
170         * @param locationLevel LocationLevel
171         * @param status Status
172         * @param position MultiLineString
173         * @param positionUpdateDate Timestamp
174         * @return newInstance LocationLine
175         */
176        public static LocationLine newInstance(String label, String name, Float bathymetry, Short utFormat, Boolean daylightSavingTime, String comments, Timestamp updateDate, ValidityStatus validityStatus, LocationClassification locationClassification, LocationLevel locationLevel, Status status, MultiLineString position, Timestamp positionUpdateDate)
177        {
178            final LocationLine entity = new LocationLineImpl();
179            entity.setLabel(label);
180            entity.setName(name);
181            entity.setBathymetry(bathymetry);
182            entity.setUtFormat(utFormat);
183            entity.setDaylightSavingTime(daylightSavingTime);
184            entity.setComments(comments);
185            entity.setUpdateDate(updateDate);
186            entity.setValidityStatus(validityStatus);
187            entity.setLocationClassification(locationClassification);
188            entity.setLocationLevel(locationLevel);
189            entity.setStatus(status);
190            entity.setPosition(position);
191            entity.setPositionUpdateDate(positionUpdateDate);
192            return entity;
193        }
194    }
195
196    /**
197     * @see Comparable#compareTo
198     */
199    public int compareTo(LocationLine o)
200    {
201        int cmp = 0;
202        if (this.getId() != null)
203        {
204            cmp = this.getId().compareTo(o.getId());
205        }
206        else
207        {
208            if (this.getPosition() != null)
209            {
210                cmp = (cmp != 0 ? cmp : this.getPosition().compareTo(o.getPosition()));
211            }
212            if (this.getPositionUpdateDate() != null)
213            {
214                cmp = (cmp != 0 ? cmp : this.getPositionUpdateDate().compareTo(o.getPositionUpdateDate()));
215            }
216        }
217        return cmp;
218    }
219// HibernateEntity.vsl merge-point
220// LocationLine.java merge-point
221}