package ru.kayashov.bar.model.entity;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.List;

@Table(name = "bar")
@Entity
@Getter
@Setter
public class BarEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String name;

    @OneToMany(mappedBy = "bar")
    private List<SessionEntity> sessions;

    @OneToMany(mappedBy = "bar")
    private List<BarIngredientStorage> ingredients;

    @OneToMany(mappedBy = "bar")
    private List<BarResident> visitors;

    @OneToMany(mappedBy = "bar")
    private List<StopList> stops;
}
