~raginggoblin/infolog/infolog

« back to all changes in this revision

Viewing changes to InfologServer/lib/hibernate-annotations-3.4.0.GA/test/org/hibernate/test/annotations/id/entities/FootballerPk.java

  • Committer: Raging Goblin
  • Date: 2013-11-16 16:51:32 UTC
  • Revision ID: raging_goblin-20131116165132-weujnptzc88uy4ah
Mavenized the project, now using shared project InfologSync

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//$Id: FootballerPk.java 14760 2008-06-11 07:33:15Z hardy.ferentschik $
2
 
package org.hibernate.test.annotations.id.entities;
3
 
 
4
 
import java.io.Serializable;
5
 
import javax.persistence.Column;
6
 
import javax.persistence.Embeddable;
7
 
 
8
 
/**
9
 
 * @author Emmanuel Bernard
10
 
 */
11
 
@Embeddable
12
 
@SuppressWarnings("serial")
13
 
public class FootballerPk implements Serializable {
14
 
        private String firstname;
15
 
        private String lastname;
16
 
 
17
 
        @Column(name = "fb_fname")
18
 
        public String getFirstname() {
19
 
                return firstname;
20
 
        }
21
 
 
22
 
        public String getLastname() {
23
 
                return lastname;
24
 
        }
25
 
 
26
 
        public void setFirstname(String firstname) {
27
 
                this.firstname = firstname;
28
 
        }
29
 
 
30
 
        public void setLastname(String lastname) {
31
 
                this.lastname = lastname;
32
 
        }
33
 
 
34
 
        public FootballerPk() {
35
 
        }
36
 
 
37
 
        public FootballerPk(String firstname, String lastname) {
38
 
                this.firstname = firstname;
39
 
                this.lastname = lastname;
40
 
 
41
 
        }
42
 
 
43
 
        public boolean equals(Object o) {
44
 
                if ( this == o ) return true;
45
 
                if ( !( o instanceof FootballerPk ) ) return false;
46
 
 
47
 
                final FootballerPk footballerPk = (FootballerPk) o;
48
 
 
49
 
                if ( !firstname.equals( footballerPk.firstname ) ) return false;
50
 
                if ( !lastname.equals( footballerPk.lastname ) ) return false;
51
 
 
52
 
                return true;
53
 
        }
54
 
 
55
 
        public int hashCode() {
56
 
                int result;
57
 
                result = firstname.hashCode();
58
 
                result = 29 * result + lastname.hashCode();
59
 
                return result;
60
 
        }
61
 
 
62
 
}