package org.example.demo.praktikum2;

import java.io.Serializable;
import java.util.List;

import jakarta.persistence.*;
import lombok.*;

@Entity
@ToString
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Person implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @SuppressWarnings("unused")
    private String name;

    @ManyToOne
    private Firma firma;

    @Singular("adresse")
    @OneToMany(mappedBy="person")
    private List<Adresse> adresse;
}
