bzr branch
http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk
|
6.1.1
by Gustav Hartvigsson
Started work on the DB/JPA stuffs |
1 |
package DB; |
2 |
||
3 |
import org.eclipse.persistence.jpa.config.UuidGenerator; |
|
4 |
||
5 |
import javax.annotation.Generated; |
|
6 |
import javax.persistence.Entity; |
|
7 |
import javax.persistence.GeneratedValue; |
|
8 |
import javax.persistence.Id; |
|
9 |
import javax.persistence.UniqueConstraint; |
|
10 |
import javax.validation.constraints.NotNull; |
|
11 |
import java.io.Serializable; |
|
12 |
import java.math.BigInteger; |
|
13 |
import java.sql.Date; |
|
14 |
import java.util.UUID; |
|
15 |
||
16 |
@Entity
|
|
17 |
public class Student implements Serializable { |
|
18 |
||
19 |
@Id |
|
20 |
@GeneratedValue |
|
21 |
private UUID id; |
|
22 |
||
23 |
@NotNull |
|
24 |
protected String firstName, lastName; |
|
25 |
||
|
8
by Gustav Hartvigsson
* Added getters and setters |
26 |
|
|
6.1.1
by Gustav Hartvigsson
Started work on the DB/JPA stuffs |
27 |
protected String city, street, postCode, houseNumber, apartmentNumber; |
28 |
||
29 |
@NotNull |
|
30 |
protected Date dateOfBirth; |
|
31 |
||
32 |
public String |
|
33 |
getFullName () { |
|
34 |
return firstName + " " + lastName; |
|
35 |
} |
|
36 |
||
37 |
public void |
|
38 |
setId (UUID id) { |
|
39 |
this.id = id; |
|
40 |
} |
|
41 |
||
42 |
public String |
|
43 |
getCity () { |
|
44 |
return city; |
|
45 |
} |
|
46 |
||
47 |
public void |
|
48 |
setCity (String city) { |
|
49 |
this.city = city; |
|
50 |
} |
|
51 |
||
52 |
public String |
|
53 |
getStreet () { |
|
54 |
return street; |
|
55 |
} |
|
56 |
||
57 |
public void |
|
58 |
setStreet (String street) { |
|
59 |
this.street = street; |
|
60 |
} |
|
61 |
||
62 |
public String |
|
63 |
getPostCode () { |
|
64 |
return postCode; |
|
65 |
} |
|
66 |
||
67 |
public void |
|
68 |
setPostCode (String postCode) { |
|
69 |
this.postCode = postCode; |
|
70 |
} |
|
71 |
||
72 |
public String |
|
73 |
getHouseNumber () { |
|
74 |
return houseNumber; |
|
75 |
} |
|
76 |
||
77 |
public void |
|
78 |
setHouseNumber (String houseNumber) { |
|
79 |
this.houseNumber = houseNumber; |
|
80 |
} |
|
81 |
||
82 |
public String |
|
83 |
getApartmentNumber () { |
|
84 |
return apartmentNumber; |
|
85 |
} |
|
86 |
||
87 |
public void |
|
88 |
setApartmentNumber (String apartmentNumber) { |
|
89 |
this.apartmentNumber = apartmentNumber; |
|
90 |
} |
|
91 |
||
92 |
public Date |
|
93 |
getDateOfBirth () { |
|
94 |
return dateOfBirth; |
|
95 |
} |
|
96 |
||
97 |
public void |
|
98 |
setDateOfBirth (Date dateOfBirth) { |
|
99 |
this.dateOfBirth = dateOfBirth; |
|
100 |
} |
|
101 |
||
102 |
public UUID |
|
103 |
getId () { |
|
104 |
return id; |
|
105 |
} |
|
106 |
||
107 |
public String |
|
108 |
getFirstName () { |
|
109 |
return firstName; |
|
110 |
} |
|
111 |
||
112 |
public String |
|
113 |
getLastName () { |
|
114 |
return lastName; |
|
115 |
} |
|
116 |
||
117 |
public void |
|
118 |
setFirstName (String firstName) { |
|
119 |
this.firstName = firstName; |
|
120 |
} |
|
121 |
||
122 |
public void |
|
123 |
setLastName (String lastName) { |
|
124 |
this.lastName = lastName; |
|
125 |
} |
|
126 |
||
127 |
||
128 |
}
|