解决延迟加载bug
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
|
||||
package cn.ysk.cashier.system.domain;
|
||||
|
||||
import cn.ysk.cashier.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import cn.ysk.cashier.base.BaseEntity;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
@@ -29,7 +28,7 @@ public class DictDetail extends BaseEntity implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@JoinColumn(name = "dict_id")
|
||||
@ManyToOne(fetch=FetchType.LAZY)
|
||||
@ManyToOne(fetch=FetchType.EAGER)
|
||||
@ApiModelProperty(value = "字典", hidden = true)
|
||||
private Dict dict;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
package cn.ysk.cashier.system.domain;
|
||||
|
||||
import cn.ysk.cashier.base.BaseEntity;
|
||||
import cn.ysk.cashier.utils.enums.DataScopeEnum;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import cn.ysk.cashier.base.BaseEntity;
|
||||
import cn.ysk.cashier.utils.enums.DataScopeEnum;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -45,7 +45,7 @@ public class Role extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty(value = "菜单", hidden = true)
|
||||
private Set<Menu> menus;
|
||||
|
||||
@ManyToMany
|
||||
@ManyToMany(fetch = FetchType.EAGER)
|
||||
@JoinTable(name = "sys_roles_depts",
|
||||
joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "role_id")},
|
||||
inverseJoinColumns = {@JoinColumn(name = "dept_id",referencedColumnName = "dept_id")})
|
||||
|
||||
Reference in New Issue
Block a user