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