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