package com.eactive.eai.rms.data.entity.man.audit;

import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

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

import lombok.Data;
import lombok.EqualsAndHashCode;

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

@Entity

@Table(name = "audit_log", indexes = {
		@Index(name = "idx_system_code_last_modified_date", columnList = "system_code, last_modified_date")
})
@org.hibernate.annotations.Table(appliesTo = "audit_log", comment = "Audit 정보")
public class AuditLogEntity extends AbstractEntity<Long> {

	private static final long serialVersionUID = 1L;

	@Id
	@TableGenerator(name = "audit_log", table = "hibernate_sequences", initialValue = 1, allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "audit_log")
	@Column(name = "id")
	private Long id;

	@Column(name = "system_code")
	private String systemCode;

	@Column(name = "log_type")
	private String logType;
	
	@Column(name = "log_type_text")
	private String logTypeText;
	
	@Column(name = "command")
	private String command;

	@Column(name = "remote_address")
	private String remoteAddress;

	@Column(name = "message")
	private String message;

	@Column(name = "parameters", length = 4000)
	private String parameters;

	@Column(name = "user_id")
	private String userId;

	@Column(name = "last_modified_date")
	private LocalDateTime lastModifiedDate;

}
