package com.eactive.kakao.rolling;

import java.time.LocalDateTime;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Comment;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import com.eactive.eai.data.entity.AbstractEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true)

@Entity
@Table(name = "current_commit_id")
@org.hibernate.annotations.Table(appliesTo = "current_commit_id", comment = "현재 Commit id를 저장")
public class CurrentCommitId extends AbstractEntity<Long> {

	private static final long serialVersionUID = 1L;

	public static final Long CURRENT_COMMIT_ID_ID = 1l;

	@Id
	private Long id;

	@OneToOne(cascade = CascadeType.PERSIST)
	@Comment("현재 Commit id")
	private RollingSuffix rollingSuffix;

	@CreatedDate
	private LocalDateTime createdDate;

	@LastModifiedDate
	private LocalDateTime lastModifiedDate;

}
