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

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

import javax.persistence.*;

@Table(name = "TB_USER_CUST")
@Entity
@Getter
@Setter
@NoArgsConstructor
@DynamicUpdate
@IdClass(TbUserCustId.class)
public class TbUserCust {

    @Id
    @Column(name = "CUST_CODE", nullable = false, length = 20)
    private String custCode;
    @Id
    @Column(name = "SERVICE_GROUP", nullable = false, length = 20)
    private String serviceGroup;
    @Id
    @Column(name = "USER_SEQ", nullable = false)
    private Long userSeq;
//    @Id
//    @Column(name = "LAST_USE_SERVICE_GROUP", nullable = false)
//    private String lastUseServiceGroup;

    @Builder
    public TbUserCust(String custCode, String serviceGroup, Long userSeq) {
        this.custCode = custCode;
        this.serviceGroup = serviceGroup;
        this.userSeq = userSeq;
    }
}
