poc completed
This commit is contained in:
@@ -6,10 +6,13 @@ import jakarta.persistence.Id;
|
||||
import jakarta.persistence.MappedSuperclass;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.annotations.JdbcTypeCode;
|
||||
import org.hibernate.annotations.UpdateTimestamp;
|
||||
import org.hibernate.type.SqlTypes;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@Getter
|
||||
@@ -25,4 +28,13 @@ public class BaseEntity {
|
||||
@JdbcTypeCode(SqlTypes.UUID)
|
||||
@Column(name = "id", updatable = false, nullable = false)
|
||||
private UUID id;
|
||||
|
||||
@CreationTimestamp
|
||||
@Column(name = "created_at", nullable = true, updatable = false)
|
||||
private LocalDateTime createdAt; // Or Date, Timestamp
|
||||
|
||||
@UpdateTimestamp
|
||||
@Column(name = "updated_at", nullable = true)
|
||||
private LocalDateTime updatedAt; // Or Date, Timestamp
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user