package dev.ksan.etfoglasiserver.model;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Setter;

import java.util.UUID;

@Entity
@Table(name = "alt_subject")
public class SubjectAlt {
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private UUID id;

  @Setter
  @Column(nullable = false)
  String name;

  @Setter
  @ManyToOne(fetch = FetchType.EAGER)
  @JoinColumn(nullable = false)
  private Subject subject;

  public SubjectAlt() {}
  public SubjectAlt(String name, Subject subject) {
    this.name = name;
    this.subject = subject;
  }

  public UUID getId() {
    return this.id;
  }

  public String getName() {
    return this.name;
  }

  public Subject getSubject() {
    return this.subject;
  }

}
