bug fix: "could not initialize proxy - no Session"
This commit is contained in:
parent
a17444abdb
commit
d2187c4913
@ -25,7 +25,7 @@ public class Merchants {
|
|||||||
private String description;//店铺描述
|
private String description;//店铺描述
|
||||||
|
|
||||||
//商家和菜品是一对多的关系,有mappedBy的时候,表示Merchants的dishes 字段放弃维护权,而将维护权交给了Dishes的关联属性merchants
|
//商家和菜品是一对多的关系,有mappedBy的时候,表示Merchants的dishes 字段放弃维护权,而将维护权交给了Dishes的关联属性merchants
|
||||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
@JoinTable(name = "merchants_dishes",
|
@JoinTable(name = "merchants_dishes",
|
||||||
joinColumns = @JoinColumn(name = "merchantsId"),
|
joinColumns = @JoinColumn(name = "merchantsId"),
|
||||||
inverseJoinColumns = @JoinColumn(name = "dishesId"))
|
inverseJoinColumns = @JoinColumn(name = "dishesId"))
|
||||||
|
@ -23,7 +23,7 @@ public class Orders {
|
|||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;//订单ID
|
private Long id;//订单ID
|
||||||
|
|
||||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
@JoinTable(name = "orders_orderDishes",
|
@JoinTable(name = "orders_orderDishes",
|
||||||
joinColumns = {@JoinColumn(name = "ordersId", referencedColumnName = "id")},
|
joinColumns = {@JoinColumn(name = "ordersId", referencedColumnName = "id")},
|
||||||
inverseJoinColumns = {@JoinColumn(name = "orderDishesId", referencedColumnName = "id")})
|
inverseJoinColumns = {@JoinColumn(name = "orderDishesId", referencedColumnName = "id")})
|
||||||
|
@ -14,8 +14,8 @@ public class Permissions {
|
|||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;//主键,权限ID
|
private Long id;//主键,权限ID
|
||||||
@Column(name = "description")
|
@Column(name = "name")
|
||||||
private String description;//权限名称
|
private String name;//权限名称
|
||||||
@Column(name = "url")
|
@Column(name = "url")
|
||||||
private String url;//权限对应的URL
|
private String url;//权限对应的URL
|
||||||
}
|
}
|
||||||
|
@ -17,11 +17,11 @@ public class RolesPermissions {
|
|||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;//主键
|
private Long id;//主键
|
||||||
|
|
||||||
@OneToMany(targetEntity = Roles.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
@OneToMany(targetEntity = Roles.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
@Column(name = "rolesId")
|
@Column(name = "rolesId")
|
||||||
private List<Roles> roles;//角色ID
|
private List<Roles> roles;//角色ID
|
||||||
|
|
||||||
@OneToMany(targetEntity = Permissions.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
@OneToMany(targetEntity = Permissions.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
@Column(name = "permissionsId")
|
@Column(name = "permissionsId")
|
||||||
private List<Permissions> permissions;//权限ID
|
private List<Permissions> permissions;//权限ID
|
||||||
}
|
}
|
||||||
|
@ -25,13 +25,13 @@ public class Users {
|
|||||||
private String address;//家庭住址
|
private String address;//家庭住址
|
||||||
|
|
||||||
//一个用户可能会有多个订单,关系是一对多
|
//一个用户可能会有多个订单,关系是一对多
|
||||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
@JoinTable(name = "users_orders",
|
@JoinTable(name = "users_orders",
|
||||||
joinColumns = {@JoinColumn(name = "usersId", referencedColumnName = "id")},
|
joinColumns = {@JoinColumn(name = "usersId", referencedColumnName = "id")},
|
||||||
inverseJoinColumns = {@JoinColumn(name = "ordersId", referencedColumnName = "id")})
|
inverseJoinColumns = {@JoinColumn(name = "ordersId", referencedColumnName = "id")})
|
||||||
private List<Orders> orders;//订单
|
private List<Orders> orders;//订单
|
||||||
|
|
||||||
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
@JoinTable(name = "users_roles",
|
@JoinTable(name = "users_roles",
|
||||||
joinColumns = {@JoinColumn(name = "usersId", referencedColumnName = "id")},
|
joinColumns = {@JoinColumn(name = "usersId", referencedColumnName = "id")},
|
||||||
inverseJoinColumns = {@JoinColumn(name = "rolesId", referencedColumnName = "id")})
|
inverseJoinColumns = {@JoinColumn(name = "rolesId", referencedColumnName = "id")})
|
||||||
|
Loading…
Reference in New Issue
Block a user