content: package com.bookstore.entity;
  
  import javax.persistence.CollectionTable;
  import javax.persistence.Column;
  import javax.persistence.ElementCollection;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import javax.persistence.JoinColumn;
  import javax.persistence.OrderColumn;
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.List;
  
  @Entity
  public class ShoppingCart implements Serializable {
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      private String owner;
  
      @ElementCollection
      @OrderColumn(name = "index_no")
      @CollectionTable(name = "shopping_cart_books",
              joinColumns = @JoinColumn(name = "shopping_cart_id"))
      @Column(name="title")
      private List<String> books = new ArrayList<>();
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getOwner() {
          return owner;
      }
  
      public void setOwner(String owner) {
          this.owner = owner;
      }
  
      public List<String> getBooks() {
          return books;
      }
  
      public void setBooks(List<String> books) {
          this.books = books;
      }
  }