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.playground; 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.data.survey.fishingTrip.FishingTripImpl; 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 PlaygroundFishingTripVesselMaster 038 */ 039public class PlaygroundFishingTripVesselMasterPK implements Serializable, Comparable<PlaygroundFishingTripVesselMasterPK> 040{ 041 /** 042 * The serial version UID of this class. Needed for serialization. 043 */ 044 private static final long serialVersionUID = 7009089534124415157L; 045 046 public PlaygroundFishingTripVesselMasterPK() 047 { 048 } 049 050 public PlaygroundFishingTripVesselMasterPK(FishingTripImpl fishingTrip, PlaygroundVesselMasterImpl playgroundVesselMaster, Integer rank) 051 { 052 this.fishingTrip = fishingTrip; 053 this.playgroundVesselMaster = playgroundVesselMaster; 054 this.rank = rank; 055 } 056 057 private FishingTripImpl fishingTrip; 058 059 public FishingTripImpl getFishingTrip() 060 { 061 return this.fishingTrip; 062 } 063 064 public void setFishingTrip(FishingTripImpl fishingTrip) 065 { 066 this.fishingTrip = fishingTrip; 067 } 068 069 private PlaygroundVesselMasterImpl playgroundVesselMaster; 070 071 public PlaygroundVesselMasterImpl getPlaygroundVesselMaster() 072 { 073 return this.playgroundVesselMaster; 074 } 075 076 public void setPlaygroundVesselMaster(PlaygroundVesselMasterImpl playgroundVesselMaster) 077 { 078 this.playgroundVesselMaster = playgroundVesselMaster; 079 } 080 081 private Integer rank; 082 083 /** 084 * Numéro d'ordre du patron de peche, dans la marée. 085 */ 086 public Integer getRank() 087 { 088 return this.rank; 089 } 090 091 public void setRank(Integer rank) 092 { 093 this.rank = rank; 094 } 095 096 @Override 097 public boolean equals(Object object) 098 { 099 if (this == object) 100 { 101 return true; 102 } 103 if (!(object instanceof PlaygroundFishingTripVesselMasterPK)) 104 { 105 return false; 106 } 107 final PlaygroundFishingTripVesselMasterPK that = (PlaygroundFishingTripVesselMasterPK)object; 108 return new EqualsBuilder() 109 .append(this.getFishingTrip(),that.getFishingTrip()) 110 .append(this.getPlaygroundVesselMaster(),that.getPlaygroundVesselMaster()) 111 .append(this.getRank(), that.getRank()) 112 .isEquals(); 113 } 114 115 @Override 116 public int hashCode() 117 { 118 return new HashCodeBuilder() 119 .append(getFishingTrip()) 120 .append(getPlaygroundVesselMaster()) 121 .append(getRank()) 122 .toHashCode(); 123 } 124 125 /** 126 * @see Comparable#compareTo 127 */ 128 @Override 129 public int compareTo(PlaygroundFishingTripVesselMasterPK o) 130 { 131 int cmp = 0; 132 if (this.getRank() != null) 133 { 134 cmp = this.getRank().compareTo(o.getRank()); 135 } 136 return cmp; 137 } 138}