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 2
2
3
3
import org .springframework .boot .SpringApplication ;
4
4
import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
+ import org .springframework .data .jpa .repository .config .EnableJpaAuditing ;
5
6
6
7
@ SpringBootApplication
8
+ @ EnableJpaAuditing
7
9
public class CommitFieldApplication {
8
10
9
11
public static void main (String [] args ) {
Original file line number Diff line number Diff line change 4
4
import jakarta .persistence .Entity ;
5
5
import jakarta .persistence .Id ;
6
6
import lombok .Builder ;
7
+ import lombok .Getter ;
7
8
8
9
@ Entity
9
- @ Builder
10
- public class User extends BaseEntity {
11
- @ Id
12
- private long id ;
10
+ @ Getter
11
+ class User extends BaseEntity {
13
12
private String email ;
14
13
private String nickname ;
15
14
private String password ;
Original file line number Diff line number Diff line change 1
1
package cmf .commitField .global .jpa ;
2
2
3
+ import jakarta .persistence .EntityListeners ;
3
4
import jakarta .persistence .GeneratedValue ;
4
5
import jakarta .persistence .Id ;
5
- import lombok .EqualsAndHashCode ;
6
- import lombok .Getter ;
6
+ import jakarta .persistence .MappedSuperclass ;
7
+ import lombok .*;
8
+ import lombok .experimental .SuperBuilder ;
7
9
import org .springframework .data .annotation .CreatedDate ;
10
+ import org .springframework .data .jpa .domain .support .AuditingEntityListener ;
8
11
9
12
import java .time .LocalDateTime ;
10
13
11
14
import static jakarta .persistence .GenerationType .IDENTITY ;
15
+ import static lombok .AccessLevel .PROTECTED ;
12
16
17
+ @ MappedSuperclass
18
+ @ NoArgsConstructor (access = PROTECTED )
19
+ @ AllArgsConstructor (access = PROTECTED )
20
+ @ Getter
21
+ @ SuperBuilder
22
+ @ EntityListeners (AuditingEntityListener .class )
23
+ @ ToString
24
+ @ EqualsAndHashCode (onlyExplicitlyIncluded = true )
13
25
public class BaseEntity {
14
26
@ Id
15
27
@ GeneratedValue (strategy = IDENTITY )
You canโt perform that action at this time.
0 commit comments