package com.its.op.entity.its.link;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 링크 소통상황 수집 이력 Entity Class
 */
@Getter
@NoArgsConstructor//(access = AccessLevel.PROTECTED)
@Builder
@AllArgsConstructor
@ApiModel("링크 소통상황 수집 이력")
@Entity
@Table(name = "TB_LINK_TRAF_CLCT_HS")
@IdClass(TbLinkTrafClctHsKey.class)
public class TbLinkTrafClctHs implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("링크ID")  // N NUMBER(10)
    @Id
    @Column(name = "LINK_ID", nullable = false, columnDefinition = "NUMBER", length = 10)
    private Long linkId;

    @ApiModelProperty("수집 시스템 코드")  // N VARCHAR(7)
    @Id
    @Column(name = "CLCT_SYST_CD", nullable = false, length = 7)
    private String clctSystCd;

    @ApiModelProperty("가공 일시")  // N VARCHAR(14)
    @Id
    @Column(name = "PRCN_DT", nullable = false, length = 14)
    private String prcnDt;

    @ApiModelProperty("속도")  // Y NUMBER(3)
    @Column(name = "SPED", columnDefinition = "NUMBER", length = 3)
    private Integer sped;

    @OneToOne//(fetch = FetchType.EAGER)
    @JoinColumn(insertable=false, updatable=false, name="LINK_ID", referencedColumnName = "LINK_ID")
    TbLink link;

}
