001// license-header java merge-point
002//
003// Attention: Generated code! Do not modify by hand!
004// Generated by: hibernate/HibernateEntityPK.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.LocationImpl;
032import java.io.Serializable;
033import org.apache.commons.lang3.builder.EqualsBuilder;
034import org.apache.commons.lang3.builder.HashCodeBuilder;
035
036/**
037 * Primary key class for SpatialItem2Location
038 */
039public class SpatialItem2LocationPK implements Serializable, Comparable<SpatialItem2LocationPK>
040{
041    /**
042     * The serial version UID of this class. Needed for serialization.
043     */
044    private static final long serialVersionUID = -5434631978329215648L;
045
046    public SpatialItem2LocationPK()
047    {
048    }
049
050    public SpatialItem2LocationPK(LocationImpl location, SpatialItemImpl spatialItem)
051    {
052        this.location = location;
053        this.spatialItem = spatialItem;
054    }
055
056    private LocationImpl location;
057
058    public LocationImpl getLocation()
059    {
060        return this.location;
061    }
062
063    public void setLocation(LocationImpl location)
064    {
065        this.location = location;
066    }
067
068    private SpatialItemImpl spatialItem;
069
070    public SpatialItemImpl getSpatialItem()
071    {
072        return this.spatialItem;
073    }
074
075    public void setSpatialItem(SpatialItemImpl spatialItem)
076    {
077        this.spatialItem = spatialItem;
078    }
079
080    @Override
081    public boolean equals(Object object)
082    {
083        if (this == object)
084        {
085            return true;
086        }
087        if (!(object instanceof SpatialItem2LocationPK))
088        {
089            return false;
090        }
091        final SpatialItem2LocationPK that = (SpatialItem2LocationPK)object;
092        return new EqualsBuilder()
093            .append(this.getLocation(),that.getLocation())
094            .append(this.getSpatialItem(),that.getSpatialItem())
095            .isEquals();
096    }
097
098    @Override
099    public int hashCode()
100    {
101        return new HashCodeBuilder()
102            .append(getLocation())
103            .append(getSpatialItem())
104            .toHashCode();
105    }
106
107    /**
108     * @see Comparable#compareTo
109     */
110    @Override
111    public int compareTo(SpatialItem2LocationPK o)
112    {
113        int cmp = 0;
114        return cmp;
115    }
116}