Initial commit
This commit is contained in:
22
backend/src/main/java/com/maternalmall/domain/CartItem.java
Normal file
22
backend/src/main/java/com/maternalmall/domain/CartItem.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.maternalmall.domain;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "cart_item", uniqueConstraints = @UniqueConstraint(columnNames = {"customerId", "productId"}))
|
||||
public class CartItem {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Long customerId;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Long productId;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Integer quantity;
|
||||
}
|
||||
Reference in New Issue
Block a user