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


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

import javax.persistence.*;

@Table(name = "TB_SERVICE_GROUP_POLICY")
@Entity
@Getter
@Setter
@NoArgsConstructor
@DynamicUpdate
@IdClass(TbServiceGroupPolicyId.class)
public class TbServiceGroupPolicy {

    @Id
    @Column(name = "AUTH_GROUP_SEQ", nullable = false)
    private Long authGroupSeq;
    @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 TbServiceGroupPolicy(Long authGroupSeq, String serviceGroup, String policyVal, String custCode) {
        this.authGroupSeq = authGroupSeq;
        this.serviceGroup = serviceGroup;
        this.policyVal = policyVal;
        this.custCode = custCode;
    }
}
