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