You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
2.1 KiB
77 lines
2.1 KiB
package com.cm.demanderetraiteanticipe.domain;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
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 java.io.Serializable;
|
|
import java.time.Instant;
|
|
import javax.persistence.Column;
|
|
import javax.persistence.EntityListeners;
|
|
import javax.persistence.MappedSuperclass;
|
|
|
|
/**
|
|
* Base abstract class for entities which will hold definitions for created, last modified, created by,
|
|
* last modified by attributes.
|
|
*/
|
|
@MappedSuperclass
|
|
@EntityListeners(AuditingEntityListener.class)
|
|
public abstract class AbstractAuditingEntity implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
@CreatedBy
|
|
@Column(name = "created_by", nullable = false, length = 50, updatable = false)
|
|
@JsonIgnore
|
|
private String createdBy;
|
|
|
|
@CreatedDate
|
|
@Column(name = "created_date", updatable = false)
|
|
@JsonIgnore
|
|
private Instant createdDate = Instant.now();
|
|
|
|
@LastModifiedBy
|
|
@Column(name = "last_modified_by", length = 50)
|
|
@JsonIgnore
|
|
private String lastModifiedBy;
|
|
|
|
@LastModifiedDate
|
|
@Column(name = "last_modified_date")
|
|
@JsonIgnore
|
|
private Instant lastModifiedDate = Instant.now();
|
|
|
|
public String getCreatedBy() {
|
|
return createdBy;
|
|
}
|
|
|
|
public void setCreatedBy(String createdBy) {
|
|
this.createdBy = createdBy;
|
|
}
|
|
|
|
public Instant getCreatedDate() {
|
|
return createdDate;
|
|
}
|
|
|
|
public void setCreatedDate(Instant createdDate) {
|
|
this.createdDate = createdDate;
|
|
}
|
|
|
|
public String getLastModifiedBy() {
|
|
return lastModifiedBy;
|
|
}
|
|
|
|
public void setLastModifiedBy(String lastModifiedBy) {
|
|
this.lastModifiedBy = lastModifiedBy;
|
|
}
|
|
|
|
public Instant getLastModifiedDate() {
|
|
return lastModifiedDate;
|
|
}
|
|
|
|
public void setLastModifiedDate(Instant lastModifiedDate) {
|
|
this.lastModifiedDate = lastModifiedDate;
|
|
}
|
|
}
|