File tree Expand file tree Collapse file tree 6 files changed +66
-5
lines changed
board/adapter/driven/persistence/entity Expand file tree Collapse file tree 6 files changed +66
-5
lines changed Original file line number Diff line number Diff line change 8
8
import lombok .Getter ;
9
9
import lombok .NoArgsConstructor ;
10
10
import me .nettee .board .application .domain .type .BoardStatus ;
11
- import me .nettee .core .jpa .support .BaseTimeEntity ;
11
+ import me .nettee .core .jpa .support .LongBaseTimeEntity ;
12
12
import org .hibernate .annotations .DynamicUpdate ;
13
13
14
14
import java .util .Objects ;
17
17
@ DynamicUpdate
18
18
@ NoArgsConstructor (access = AccessLevel .PROTECTED )
19
19
@ Entity (name = "board" )
20
- public class BoardEntity extends BaseTimeEntity {
20
+ public class BoardEntity extends LongBaseTimeEntity {
21
21
private String title ;
22
22
23
23
private String content ;
Original file line number Diff line number Diff line change 7
7
import org .springframework .data .annotation .LastModifiedDate ;
8
8
import org .springframework .data .jpa .domain .support .AuditingEntityListener ;
9
9
10
+ import java .io .Serializable ;
10
11
import java .time .Instant ;
11
12
12
13
@ Getter
13
14
@ MappedSuperclass
14
15
@ EntityListeners (AuditingEntityListener .class )
15
- public abstract class BaseTimeEntity extends BaseEntity {
16
+ public abstract class BaseTimeEntity implements Serializable {
16
17
@ CreatedDate
17
18
private Instant createdAt ;
18
19
19
20
@ LastModifiedDate
20
21
private Instant updatedAt ;
21
- }
22
+ }
Original file line number Diff line number Diff line change 10
10
11
11
@ Getter
12
12
@ MappedSuperclass
13
- public abstract class BaseEntity implements Serializable {
13
+ public abstract class LongBaseEntity implements Serializable {
14
14
@ Id
15
15
@ GeneratedValue (strategy = GenerationType .IDENTITY )
16
16
private Long id ;
Original file line number Diff line number Diff line change
1
+ package me .nettee .core .jpa .support ;
2
+
3
+ import jakarta .persistence .EntityListeners ;
4
+ import jakarta .persistence .MappedSuperclass ;
5
+ import lombok .Getter ;
6
+ import org .springframework .data .annotation .CreatedDate ;
7
+ import org .springframework .data .annotation .LastModifiedDate ;
8
+ import org .springframework .data .jpa .domain .support .AuditingEntityListener ;
9
+
10
+ import java .time .Instant ;
11
+
12
+ @ Getter
13
+ @ MappedSuperclass
14
+ @ EntityListeners (AuditingEntityListener .class )
15
+ public abstract class LongBaseTimeEntity extends LongBaseEntity {
16
+ @ CreatedDate
17
+ private Instant createdAt ;
18
+
19
+ @ LastModifiedDate
20
+ private Instant updatedAt ;
21
+ }
Original file line number Diff line number Diff line change
1
+ package me .nettee .core .jpa .support ;
2
+
3
+ import jakarta .persistence .GeneratedValue ;
4
+ import jakarta .persistence .GenerationType ;
5
+ import jakarta .persistence .Id ;
6
+ import jakarta .persistence .MappedSuperclass ;
7
+ import lombok .Getter ;
8
+
9
+ import java .io .Serializable ;
10
+ import java .util .UUID ;
11
+
12
+ @ Getter
13
+ @ MappedSuperclass
14
+ public abstract class UuidBaseEntity implements Serializable {
15
+ @ Id
16
+ @ GeneratedValue (strategy = GenerationType .UUID )
17
+ private UUID id ;
18
+ }
Original file line number Diff line number Diff line change
1
+ package me .nettee .core .jpa .support ;
2
+
3
+ import jakarta .persistence .EntityListeners ;
4
+ import jakarta .persistence .MappedSuperclass ;
5
+ import lombok .Getter ;
6
+ import org .springframework .data .annotation .CreatedDate ;
7
+ import org .springframework .data .annotation .LastModifiedDate ;
8
+ import org .springframework .data .jpa .domain .support .AuditingEntityListener ;
9
+
10
+ import java .time .Instant ;
11
+
12
+ @ Getter
13
+ @ MappedSuperclass
14
+ @ EntityListeners (AuditingEntityListener .class )
15
+ public abstract class UuidBaseTimeEntity extends UuidBaseEntity {
16
+ @ CreatedDate
17
+ private Instant createdAt ;
18
+
19
+ @ LastModifiedDate
20
+ private Instant updatedAt ;
21
+ }
You can’t perform that action at this time.
0 commit comments