View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: Generated code! Do not modify by hand!
4   // Generated by: hibernate/HibernateEntityPK.vsl in andromda-hibernate-cartridge.
5   //
6   package fr.ifremer.quadrige2.core.dao.referential.taxon;
7   
8   /*-
9    * #%L
10   * Quadrige2 Core :: Server API
11   * %%
12   * Copyright (C) 2017 Ifremer
13   * %%
14   * This program is free software: you can redistribute it and/or modify
15   * it under the terms of the GNU Affero General Public License as published by
16   * the Free Software Foundation, either version 3 of the License, or
17   * (at your option) any later version.
18   * 
19   * This program is distributed in the hope that it will be useful,
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22   * GNU General Public License for more details.
23   * 
24   * You should have received a copy of the GNU Affero General Public License
25   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
26   * #L%
27   */
28  
29  import java.io.Serializable;
30  import org.apache.commons.lang3.builder.EqualsBuilder;
31  import org.apache.commons.lang3.builder.HashCodeBuilder;
32  
33  /**
34   * Primary key class for VirtualComponent
35   */
36  public class VirtualComponentPK implements Serializable, Comparable<VirtualComponentPK>
37  {
38      /**
39       * The serial version UID of this class. Needed for serialization.
40       */
41      private static final long serialVersionUID = -2345051973744045898L;
42  
43      public VirtualComponentPK()
44      {
45      }
46  
47      public VirtualComponentPK(TaxonNameImpl taxonName, ReferenceTaxonImpl referenceTaxon)
48      {
49          this.taxonName = taxonName;
50          this.referenceTaxon = referenceTaxon;
51      }
52  
53      private TaxonNameImpl taxonName;
54  
55      public TaxonNameImpl getTaxonName()
56      {
57          return this.taxonName;
58      }
59  
60      public void setTaxonName(TaxonNameImpl taxonName)
61      {
62          this.taxonName = taxonName;
63      }
64  
65      private ReferenceTaxonImpl referenceTaxon;
66  
67      public ReferenceTaxonImpl getReferenceTaxon()
68      {
69          return this.referenceTaxon;
70      }
71  
72      public void setReferenceTaxon(ReferenceTaxonImpl referenceTaxon)
73      {
74          this.referenceTaxon = referenceTaxon;
75      }
76  
77      @Override
78      public boolean equals(Object object)
79      {
80          if (this == object)
81          {
82              return true;
83          }
84          if (!(object instanceof VirtualComponentPK))
85          {
86              return false;
87          }
88          final VirtualComponentPK that = (VirtualComponentPK)object;
89          return new EqualsBuilder()
90              .append(this.getTaxonName(),that.getTaxonName())
91              .append(this.getReferenceTaxon(),that.getReferenceTaxon())
92              .isEquals();
93      }
94  
95      @Override
96      public int hashCode()
97      {
98          return new HashCodeBuilder()
99              .append(getTaxonName())
100             .append(getReferenceTaxon())
101             .toHashCode();
102     }
103 
104     /**
105      * @see Comparable#compareTo
106      */
107     @Override
108     public int compareTo(VirtualComponentPK o)
109     {
110         int cmp = 0;
111         return cmp;
112     }
113 }