package com.example.todolist.entity;

import java.time.LocalDateTime;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
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 lombok.Getter;
import lombok.Setter;

@MappedSuperclass // ①
@Setter
@Getter
public class AuditInfo {

	@CreatedBy
	@Column(name = "created_by", updatable = false)
	protected String createdBy;

	@CreatedDate
	@Column(name = "created_on", updatable = false)
	protected LocalDateTime createdOn;
	
	@LastModifiedBy
	@Column(name = "lastmodified_by")
	protected String lastModifiedBy;
	
	@LastModifiedDate
	@Column(name = "lastmodified_on")
	protected LocalDateTime lastModifiedOn;
}