Line | |
---|
1 | package com.tourMate.entities;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 | import org.jetbrains.annotations.NotNull;
|
---|
5 |
|
---|
6 | @Entity
|
---|
7 | @Table(name = "roles")
|
---|
8 | public class Role {
|
---|
9 |
|
---|
10 | private long roleId;
|
---|
11 | private String roleName;
|
---|
12 |
|
---|
13 | public Role(String roleName) {
|
---|
14 | this.roleName = roleName;
|
---|
15 | }
|
---|
16 |
|
---|
17 | public Role() {
|
---|
18 | }
|
---|
19 |
|
---|
20 | @Id
|
---|
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
22 | @Column(name = "role_id", unique = true, nullable = false)
|
---|
23 | @NotNull
|
---|
24 | public long getRoleId() {
|
---|
25 | return roleId;
|
---|
26 | }
|
---|
27 |
|
---|
28 | public void setRoleId(long roleId) {
|
---|
29 | this.roleId = roleId;
|
---|
30 | }
|
---|
31 |
|
---|
32 | @Column(name = "name", unique = true, nullable = false)
|
---|
33 | public String getRoleName() {
|
---|
34 | return roleName;
|
---|
35 | }
|
---|
36 |
|
---|
37 | public void setRoleName(String roleName) {
|
---|
38 | this.roleName = roleName;
|
---|
39 | }
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.