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

import com.eactive.eai.data.entity.AbstractEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
import org.hibernate.annotations.Comment;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

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

@Entity
@Table(name = "tseairm37")
@org.hibernate.annotations.Table(appliesTo = "tseairm37", comment = "CMLOG기본")
public class CmLogEntity extends AbstractEntity<String> implements Serializable {
   private static final long serialVersionUID = 1L;

   @Id
   @Column(unique = true, nullable = false, length = 40)
   @Comment("GUID")
   private String guid;

   @Column(length = 8)
   @Comment("서비스타입")
   private String service_type;

   @Column(length = 4)
   @Comment("업무구분코드")
   private String appl_cd;

   @Column(length = 8)
   @Comment("반영ID")
   private String deploy_id;

   @Column(length = 1)
   @Comment("롤백여부")
   private String rollback_yn;

   @Column(length = 1)
   @Comment("성공여부")
   private String success_yn;

   @Column(length = 2000)
   @Comment("오류메시지")
   private String error_msg;

   @Column(length = 14)
   @Comment("반영시간")
   private String deploy_time;

   @Column(length = 14)
   @Comment("반영종료시간")
   private String deploy_end_time;

//   @OneToMany(
//         mappedBy = "cmLog2Entity",
//         cascade = {CascadeType.ALL},
//         orphanRemoval = true
//   )
//   @OrderBy("guid")
//   private List<CmLogDetail2Entity> cmLogDetail2Entities;

   @Override
   public @NonNull String getId() {
      return guid;
   }
}