File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
src/main/java/cmf/commitField Expand file tree Collapse file tree 2 files changed +16
-2
lines changed 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 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