All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.vfdtech.entitity_related.AuditorAware Maven / Gradle / Ivy

Go to download

A utilities service with generic tools implementation. Can be plugged into your java project. This is designed for Java 1.8

There is a newer version: 1.0.0
Show newest version
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