package com.example.projectback.model;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
public class Subject {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private String name;

    @OneToMany(mappedBy = "subject")
    private List<SubjectStudent> studentsAssoc = new ArrayList<>();

    public Subject() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<SubjectStudent> getStudentsAssoc() {
        return studentsAssoc;
    }

    public void setStudentsAssoc(List<SubjectStudent> studentsAssoc) {
        this.studentsAssoc = studentsAssoc;
    }
}
