File tree 2 files changed +5
-0
lines changed
polling-app-server/src/main/java/com/example/polls/model/audit
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 5
5
import org .springframework .data .annotation .LastModifiedDate ;
6
6
import org .springframework .data .jpa .domain .support .AuditingEntityListener ;
7
7
8
+ import javax .persistence .Column ;
8
9
import javax .persistence .EntityListeners ;
9
10
import javax .persistence .MappedSuperclass ;
10
11
import java .io .Serializable ;
19
20
public abstract class DateAudit implements Serializable {
20
21
21
22
@ CreatedDate
23
+ @ Column (nullable = false , updatable = false )
22
24
private Instant createdAt ;
23
25
24
26
@ LastModifiedDate
27
+ @ Column (nullable = false )
25
28
private Instant updatedAt ;
26
29
27
30
public Instant getCreatedAt () {
Original file line number Diff line number Diff line change 4
4
import org .springframework .data .annotation .CreatedBy ;
5
5
import org .springframework .data .annotation .LastModifiedBy ;
6
6
7
+ import javax .persistence .Column ;
7
8
import javax .persistence .MappedSuperclass ;
8
9
9
10
/**
18
19
public abstract class UserDateAudit extends DateAudit {
19
20
20
21
@ CreatedBy
22
+ @ Column (updatable = false )
21
23
private Long createdBy ;
22
24
23
25
@ LastModifiedBy
You can’t perform that action at this time.
0 commit comments