~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/Footballer.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: Footballer.java 14760 2008-06-11 07:33:15Z hardy.ferentschik $
2
 
package org.hibernate.test.annotations.id.entities;
3
 
 
4
 
import javax.persistence.DiscriminatorColumn;
5
 
import javax.persistence.Entity;
6
 
import javax.persistence.Id;
7
 
import javax.persistence.IdClass;
8
 
 
9
 
/**
10
 
 * @author Emmanuel Bernard
11
 
 */
12
 
@Entity
13
 
@IdClass(FootballerPk.class)
14
 
@DiscriminatorColumn(name = "bibi")
15
 
public class Footballer {
16
 
        private String firstname;
17
 
        private String lastname;
18
 
        private String club;
19
 
 
20
 
        public Footballer() {
21
 
        }
22
 
 
23
 
        public Footballer(String firstname, String lastname, String club) {
24
 
                this.firstname = firstname;
25
 
                this.lastname = lastname;
26
 
                this.club = club;
27
 
        }
28
 
 
29
 
        public boolean equals(Object o) {
30
 
                if ( this == o ) return true;
31
 
                if ( !( o instanceof Footballer ) ) return false;
32
 
 
33
 
                final Footballer footballer = (Footballer) o;
34
 
 
35
 
                if ( !firstname.equals( footballer.firstname ) ) return false;
36
 
                if ( !lastname.equals( footballer.lastname ) ) return false;
37
 
 
38
 
                return true;
39
 
        }
40
 
 
41
 
        public int hashCode() {
42
 
                int result;
43
 
                result = firstname.hashCode();
44
 
                result = 29 * result + lastname.hashCode();
45
 
                return result;
46
 
        }
47
 
 
48
 
        @Id
49
 
        public String getFirstname() {
50
 
                return firstname;
51
 
        }
52
 
 
53
 
        public void setFirstname(String firstname) {
54
 
                this.firstname = firstname;
55
 
        }
56
 
 
57
 
        @Id
58
 
        public String getLastname() {
59
 
                return lastname;
60
 
        }
61
 
 
62
 
        public void setLastname(String lastname) {
63
 
                this.lastname = lastname;
64
 
        }
65
 
 
66
 
        public String getClub() {
67
 
                return club;
68
 
        }
69
 
 
70
 
        public void setClub(String club) {
71
 
                this.club = club;
72
 
        }
73
 
}