package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded;

import lombok.*;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.PrePersist;
import java.time.LocalDateTime;


@Embeddable
@Getter
@RequiredArgsConstructor
public class FieldCreate {

//	@CreationTimestamp
//	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "regist_dt")
	private LocalDateTime registDt;
	@Column(name = "register", length = 50)
	private String register;


	@PrePersist
	public void preUpdate() {
		this.registDt = LocalDateTime.now();
	}


	@Builder(builderMethodName = "builder")
	public FieldCreate(String register, LocalDateTime registDt) {
		this.register = register;
		this.registDt = registDt;
	}
}
