ID类型匹配JPA要求
This commit is contained in:
parent
435f768659
commit
0c7e5753f4
@ -18,7 +18,7 @@ import java.math.BigDecimal;
|
||||
public class Dishes {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;//主键,菜品ID
|
||||
private Long id;//主键,菜品ID
|
||||
private String name;//菜品名称
|
||||
private BigDecimal price;//菜品价格
|
||||
private Integer discount;//菜品折扣
|
||||
|
@ -14,7 +14,7 @@ import java.util.List;
|
||||
public class Merchants {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;//主键,商家编号
|
||||
private Long id;//主键,商家编号
|
||||
private String name;//店铺名字
|
||||
private String address;//店铺地址
|
||||
@Column(name = "phoneNumber")
|
||||
|
@ -16,7 +16,7 @@ import lombok.NoArgsConstructor;
|
||||
public class OrderDishes {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;//主键ID
|
||||
private Long id;//主键ID
|
||||
|
||||
@OneToOne(cascade = CascadeType.ALL)
|
||||
@JoinColumn(name = "dishesID", referencedColumnName = "id")
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
public class Orders {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;//订单ID
|
||||
private Long id;//订单ID
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "orders")
|
||||
@Column(name = "orderDishesID")
|
||||
|
Loading…
Reference in New Issue
Block a user