org.vfdtech.entitity_related.AuditorAware Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utilities-and-generic-tools Show documentation
Show all versions of utilities-and-generic-tools Show documentation
A utilities service with generic tools implementation. Can be
plugged into your java project. This is designed for Java 1.8
package org.vfdtech.entitity_related;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import jakarta.persistence.Column;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.hibernate.annotations.UuidGenerator;
import java.time.LocalDateTime;
import java.util.UUID;
@Getter
@Setter
@ToString
@MappedSuperclass
public class AuditorAware {
@Id
@GeneratedValue(generator = "UUID")
@UuidGenerator
@Column(name = "id", updatable = false, nullable = false)
private String id;
@CreationTimestamp
@JsonSerialize(using = JacksonLocalDateTimeSerializer.class)
@Column(name = "created_at")
private LocalDateTime createdAt;
@UpdateTimestamp
@JsonSerialize(using = JacksonLocalDateTimeSerializer.class)
@Column(name = "last_updated_at")
private LocalDateTime lastUpdatedAt;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy