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

ru.mynewtons.starter.oauth2.domain.BaseDomain Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package ru.mynewtons.starter.oauth2.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;


@Getter
@Setter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class BaseDomain {

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @JsonFormat(pattern = "dd.MM.yyyy")
    @CreatedDate
    @Column(name = "created_date")
    private Long createdDate;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @JsonFormat(pattern = "dd.MM.yyyy")
    @LastModifiedDate
    @Column(name = "last_modified_date")
    private Long lastModifiedDate;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @CreatedBy
    @Column(name = "created_by")
    private String createdBy;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @LastModifiedBy
    @Column(name = "last_modified_by")
    private String lastModifiedBy;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy