1 package ejava.projects.edmv.bo;
2
3 import java.io.Serializable;
4
5 import javax.persistence.*;
6
7
8
9
10
11
12 @Entity(name="Person")
13 @Table(name="EDMV_PERSON")
14 @SuppressWarnings("serial")
15 public class Person implements Serializable {
16 @Id @GeneratedValue(strategy=GenerationType.IDENTITY)
17 private long id;
18
19 @Column(name="LAST_NAME", length=20)
20 private String lastName;
21
22
23 public Person() {}
24 public Person(long id) {
25 this.id = id;
26 }
27
28 public long getId() {
29 return id;
30 }
31
32 @SuppressWarnings("unused")
33 private void setId(long id) {
34 this.id = id;
35 }
36
37 public String getLastName() {
38 return lastName;
39 }
40 public void setLastName(String lastName) {
41 this.lastName = lastName;
42 }
43
44 public String toString() {
45 StringBuilder text = new StringBuilder();
46
47 text.append("id=" + id);
48 text.append(", lastName=" + lastName);
49
50 return text.toString();
51 }
52 }