Done ticket GEPAFINBE-3

This commit is contained in:
harish
2024-08-14 15:31:00 +05:30
parent 2773dfa034
commit e09f61f918
51 changed files with 2107 additions and 70 deletions

View File

@@ -0,0 +1,35 @@
package net.gepafin.tendermanagement.entities;
import jakarta.persistence.*;
import lombok.Data;
import net.gepafin.tendermanagement.util.DateTimeUtil;
import java.time.LocalDateTime;
@MappedSuperclass
@Data
public class BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", unique = true)
private Long id;
@Column(name = "CREATED_DATE", updatable = false)
LocalDateTime createdDate;
@Column(name = "UPDATED_DATE")
LocalDateTime updatedDate;
@PrePersist
public void setCreatedDate() {
this.createdDate = DateTimeUtil.DateServerToUTC(LocalDateTime.now());
this.updatedDate = DateTimeUtil.DateServerToUTC(LocalDateTime.now());
}
@PreUpdate
public void setUpdatedDate() {
this.updatedDate = DateTimeUtil.DateServerToUTC(LocalDateTime.now());
}
}