content: package io.aharoj.barbershop_backend.modules.shop.model.entity;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import io.aharoj.barbershop_backend.modules.owner.model.entity.Owner;
  import jakarta.persistence.*;
  
  @Entity
  @Table(name = "shops")
  public class Shop {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      private String name;
      private String address;
  
      // Many Shops can be owned by 1 Owner
      @ManyToOne(fetch = FetchType.LAZY, optional = false)
      @JoinColumn(name = "owner_id")
      private Owner owner;
  
      // A shop has many seats
      @OneToMany(mappedBy = "shop", cascade = CascadeType.ALL, orphanRemoval = true)
      private List<Seat> seats = new ArrayList<>();
  
      // constructors
      public Shop() {
      }
  
      public Shop(String name, String address, Owner owner) {
          this.name = name;
          this.address = address;
          this.owner = owner;
      }
  
      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 String getAddress() {
          return address;
      }
  
      public void setAddress(String address) {
          this.address = address;
      }
  
      public Owner getOwner() {
          return owner;
      }
  
      public void setOwner(Owner owner) {
          this.owner = owner;
      }
  
      public List<Seat> getSeats() {
          return seats;
      }
  
      public void setSeats(List<Seat> seats) {
          this.seats = seats;
      }
  
  
  }
  