Добавил ограничение для столбца count в таблице связи
This commit is contained in:
parent
f48ad34121
commit
bb3b42bf2d
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user