package com.bio.bio_backend.domain.base.authgroupresource.entity;

import com.bio.bio_backend.domain.base.authgroup.entity.AuthGroup;
import com.bio.bio_backend.domain.base.resource.entity.Resource;
import com.bio.bio_backend.global.constants.AppConstants;
import com.bio.bio_backend.global.entity.BaseEntity;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import org.hibernate.annotations.Comment;

@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = AppConstants.TABLE_PREFIX + "auth_group_resource")

public class AuthGroupResource extends BaseEntity {

    @JoinColumn(name = "auth_group_oid")
    @ManyToOne(fetch = FetchType.LAZY)
    @Comment("권한 그룹 OID")
    private AuthGroup authGroupOid;

    @JoinColumn(name = "resource_oid")
    @ManyToOne(fetch = FetchType.LAZY)
    @Comment("리소스 OID")
    private Resource resourceOid;
}
