File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed
src/main/java/com/example/postgresdemo/model Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .example .postgresdemo .model ;
2+
3+ import javax .persistence .*;
4+ import javax .validation .constraints .Size ;
5+
6+ @ Entity
7+ @ Table (name = "users" )
8+ public class User {
9+ @ Id
10+ @ GeneratedValue
11+ private Long id ;
12+ @ Size (min = 1 , max = 50 )
13+ @ Column (columnDefinition = "firstname" )
14+ private String firstname ;
15+ @ Size (min = 1 , max = 50 )
16+ @ Column (columnDefinition = "lastname" )
17+ private String lastname ;
18+ @ Column (columnDefinition = "password" )
19+ private String password ;
20+
21+ public User () {}
22+
23+ public User (Long id , String firstname , String lastname ) {
24+ this .id = id ;
25+ this .firstname = firstname ;
26+ this .lastname = lastname ;
27+ }
28+
29+ public Long getId () {
30+ return id ;
31+ }
32+
33+ public void setId (Long id ) {
34+ this .id = id ;
35+ }
36+
37+ public String getFirstname () {
38+ return firstname ;
39+ }
40+
41+ public void setFirstname (String firstname ) {
42+ this .firstname = firstname ;
43+ }
44+
45+ public String getLastname () {
46+ return lastname ;
47+ }
48+
49+ public void setLastname (String lastname ) {
50+ this .lastname = lastname ;
51+ }
52+
53+ public String getPassword () {
54+ return password ;
55+ }
56+
57+ public void setPassword (String password ) {
58+ this .password = password ;
59+ }
60+ }
You can’t perform that action at this time.
0 commit comments