Добавил ограничение для столбца count в таблице связи

This commit is contained in:
Илья 2024-04-20 13:59:17 +04:00
parent f48ad34121
commit bb3b42bf2d

View File

@ -5,6 +5,7 @@ import java.util.Objects;
import com.example.backend.books.model.BookEntity;
import com.example.backend.orders.model.OrderEntity;
import jakarta.persistence.Column;
import jakarta.persistence.EmbeddedId;
import jakarta.persistence.Entity;
import jakarta.persistence.JoinColumn;
@ -25,6 +26,7 @@ public class OrderBookEntity {
@MapsId("bookId")
@JoinColumn(name = "book_id")
private BookEntity book;
@Column(nullable = false)
private Integer count;
public OrderBookEntity() {