-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsers.java
More file actions
43 lines (34 loc) · 977 Bytes
/
Users.java
File metadata and controls
43 lines (34 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.example.accessingdatajpa;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Users {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long UserId;
private String firstName;
private String lastName;
protected Users() {}
public Users(String firstName, String lastName) {
this.UserId = UserId;
this.firstName = firstName;
this.lastName = lastName;
}
@Override
public String toString() {
return String.format(
"Users[UserId=%d, firstName='%s', lastName='%s']",
UserId, firstName, lastName);
}
public Long getUserId() {
return UserId;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
}