package com.example.bookstore.model;

public class OrderDetail {

    long id;

    Order order;

    Book book;

    int quantity;

    public OrderDetail() {
    }

    public OrderDetail(Book book, int quantity) {
        this.book = book;
        this.quantity = quantity;
    }

    public long getId() {
        return id;
    }

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

    public Order getOrder() {
        return order;
    }

    void setOrder(Order order) {
        this.order = order;
    }

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" {id=").append(id);
        sb.append(", book=").append(book);
        sb.append(", quantity=").append(quantity);
        sb.append("}");
        return sb.toString();
    }

}
