View Javadoc
1   /*
2    * Copyright (C) 2025 B3Partners B.V.
3    *
4    * SPDX-License-Identifier: MIT
5    */
6   package org.tailormap.api.persistence;
7   
8   import jakarta.persistence.Column;
9   import jakarta.persistence.MappedSuperclass;
10  import java.time.Instant;
11  import org.springframework.data.annotation.CreatedBy;
12  import org.springframework.data.annotation.CreatedDate;
13  import org.springframework.data.annotation.LastModifiedBy;
14  import org.springframework.data.annotation.LastModifiedDate;
15  
16  @MappedSuperclass
17  public class AuditMetadata {
18  
19    @CreatedBy
20    @Column
21    private String createdBy;
22  
23    @LastModifiedBy
24    @Column
25    private String lastModifiedBy;
26  
27    @CreatedDate
28    @Column(columnDefinition = "timestamp with time zone")
29    private Instant createdDate;
30  
31    @LastModifiedDate
32    @Column(columnDefinition = "timestamp with time zone")
33    private Instant lastModifiedDate;
34  
35    // <editor-fold desc="getters and setters">
36    public String getCreatedBy() {
37      return createdBy;
38    }
39  
40    public void setCreatedBy(String createdBy) {
41      this.createdBy = createdBy;
42    }
43  
44    public String getLastModifiedBy() {
45      return lastModifiedBy;
46    }
47  
48    public void setLastModifiedBy(String lastModifiedBy) {
49      this.lastModifiedBy = lastModifiedBy;
50    }
51  
52    public Instant getCreatedDate() {
53      return createdDate;
54    }
55  
56    public void setCreatedDate(Instant createdDate) {
57      this.createdDate = createdDate;
58    }
59  
60    public Instant getLastModifiedDate() {
61      return lastModifiedDate;
62    }
63  
64    public void setLastModifiedDate(Instant lastModifiedDate) {
65      this.lastModifiedDate = lastModifiedDate;
66    }
67    // </editor-fold>
68  }