File tree Expand file tree Collapse file tree 5 files changed +19
-7
lines changed
src/main/java/cmf/commitField Expand file tree Collapse file tree 5 files changed +19
-7
lines changed File renamed without changes.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22
33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
5+ import org .springframework .data .jpa .repository .config .EnableJpaAuditing ;
56
67@ SpringBootApplication
8+ @ EnableJpaAuditing
79public class CommitFieldApplication {
810
911 public static void main (String [] args ) {
Original file line number Diff line number Diff line change 44import jakarta .persistence .Entity ;
55import jakarta .persistence .Id ;
66import lombok .Builder ;
7+ import lombok .Getter ;
78
89@ Entity
9- @ Builder
10- public class User extends BaseEntity {
11- @ Id
12- private long id ;
10+ @ Getter
11+ class User extends BaseEntity {
1312 private String email ;
1413 private String nickname ;
1514 private String password ;
Original file line number Diff line number Diff line change 11package cmf .commitField .global .jpa ;
22
3+ import jakarta .persistence .EntityListeners ;
34import jakarta .persistence .GeneratedValue ;
45import jakarta .persistence .Id ;
5- import lombok .EqualsAndHashCode ;
6- import lombok .Getter ;
6+ import jakarta .persistence .MappedSuperclass ;
7+ import lombok .*;
8+ import lombok .experimental .SuperBuilder ;
79import org .springframework .data .annotation .CreatedDate ;
10+ import org .springframework .data .jpa .domain .support .AuditingEntityListener ;
811
912import java .time .LocalDateTime ;
1013
1114import static jakarta .persistence .GenerationType .IDENTITY ;
15+ import static lombok .AccessLevel .PROTECTED ;
1216
17+ @ MappedSuperclass
18+ @ NoArgsConstructor (access = PROTECTED )
19+ @ AllArgsConstructor (access = PROTECTED )
20+ @ Getter
21+ @ SuperBuilder
22+ @ EntityListeners (AuditingEntityListener .class )
23+ @ ToString
24+ @ EqualsAndHashCode (onlyExplicitlyIncluded = true )
1325public class BaseEntity {
1426 @ Id
1527 @ GeneratedValue (strategy = IDENTITY )
You canโt perform that action at this time.
0 commit comments