1414@ Table
1515public class User {
1616
17- @ Id
18- @ GeneratedValue (strategy = GenerationType .AUTO )
19- private Long id ;
20- @ Column (name = "firstName" )
21- private String firstName ;
22- @ Column (name ="lastName" )
17+ @ Id
18+ @ GeneratedValue (strategy = GenerationType .AUTO )
19+ private Long id ;
20+
21+ @ Column (name = "firstName" )
22+ private String firstName ;
23+
24+ @ Column (name = "lastName" )
2325 private String lastName ;
24- @ Column (name ="email" )
26+
27+ @ Column (name = "email" )
2528 private String email ;
26- @ Column (name ="password" )
29+
30+ @ Column (name = "password" )
2731 private String password ;
28-
29- @ OneToOne (mappedBy ="user" ,
30- fetch = FetchType .EAGER ,
31- cascade = CascadeType .ALL )
32- private VerificationToken verificationToken ;
33-
34- @ OneToOne (mappedBy = "user" ,fetch = FetchType .EAGER , cascade = CascadeType .ALL )
35- private Role role ;
36-
37- public VerificationToken getVerificationToken () {
38- return verificationToken ;
39- }
32+
33+ @ Column (name = "enabled" )
34+ private boolean enabled ;
4035
41- public void setVerificationToken (VerificationToken verificationToken ) {
42- this .verificationToken = verificationToken ;
43- }
36+ @ OneToOne (mappedBy = "user" , fetch = FetchType .EAGER , cascade = CascadeType .ALL )
37+ private Role role ;
4438
4539 public Long getId () {
4640 return id ;
@@ -90,6 +84,14 @@ public void setRole(Role role) {
9084 this .role = role ;
9185 }
9286
87+ public boolean isEnabled () {
88+ return enabled ;
89+ }
90+
91+ public void setEnabled (boolean enabled ) {
92+ this .enabled = enabled ;
93+ }
94+
9395 @ Override
9496 public int hashCode () {
9597 final int prime = 31 ;
@@ -111,11 +113,11 @@ public boolean equals(final Object obj) {
111113 return false ;
112114 return true ;
113115 }
116+
114117 @ Override
115118 public String toString () {
116119 final StringBuilder builder = new StringBuilder ();
117- builder .append ("User [firstName=" ).append (firstName ).append ("]" ).
118- append ("[lastName=" ).append (lastName ).append ("]" ).append ("[username" ).append (email ).append ("]" );
120+ builder .append ("User [firstName=" ).append (firstName ).append ("]" ).append ("[lastName=" ).append (lastName ).append ("]" ).append ("[username" ).append (email ).append ("]" );
119121 return builder .toString ();
120122 }
121123}
0 commit comments