package com.icomsys.main_vm.db.jpa.entity.system;

import com.icomsys.main_vm.db.jpa.entity.system.id.TbCustPolicyId;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

@Table(name = "TB_CUST_POLICY")
@Entity
@Getter
@Setter
@NoArgsConstructor
@DynamicUpdate
@IdClass(TbCustPolicyId.class)
public class TbCustPolicy {

    @Id
    @Column(name = "SERVICE_GROUP", nullable = false, length = 20)
    private String serviceGroup;
    @Id
    @Column(name = "POLICY_VAL", nullable = false, length = 100)
    private String policyVal;
    @Id
    @Column(name = "CUST_CODE", nullable = false, length = 20)
    private String custCode;

    @Builder
    public TbCustPolicy(String serviceGroup, String policyVal, String custCode) {
        this.serviceGroup = serviceGroup;
        this.policyVal = policyVal;
        this.custCode = custCode;
    }

}
