package io.delphiplatform.api.v3.decibelrdb.entity;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import io.delphiplatform.api.v3.rdb.entity.ArtistEntity;
import lombok.Getter;
import lombok.Setter;

import static io.delphiplatform.api.v3.constant.DecibelTableNames.DECIBEL_SCHEMA;
import static io.delphiplatform.api.v3.constant.DecibelTableNames.PROJECT_ARTISTS;

@Getter
@Setter
@Entity
@Table(name = PROJECT_ARTISTS, schema = DECIBEL_SCHEMA)
public class DecibelProjectArtistEntity {

    @EmbeddedId
    private DecibelProjectArtistId projectArtistId;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "artist_id", insertable = false, updatable = false)
    private ArtistEntity artist;

}
