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