Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 使用一对多双向时找不到实体找不到异常_Spring_Hibernate_Spring Boot_Spring Data - Fatal编程技术网

Spring 使用一对多双向时找不到实体找不到异常

Spring 使用一对多双向时找不到实体找不到异常,spring,hibernate,spring-boot,spring-data,Spring,Hibernate,Spring Boot,Spring Data,使用邮递员发布数据或运行程序时,遇到以下错误: 找不到id为1的com.example.entity.Product;嵌套异常为javax.persistence.EntityNotFoundException:找不到id为1的com.example.entity.Product 下面是父类: @实体 公共类客户{ @身份证 @生成值 私有整数客户Id; 私有字符串cust_name; 私人城市; @OneToMany(mappedBy=“客户”) 私人上市产品; } 儿童班: @实体 公共类产

使用邮递员发布数据或运行程序时,遇到以下错误:

找不到id为1的com.example.entity.Product;嵌套异常为javax.persistence.EntityNotFoundException:找不到id为1的com.example.entity.Product

下面是父类:

@实体
公共类客户{
@身份证
@生成值
私有整数客户Id;
私有字符串cust_name;
私人城市;
@OneToMany(mappedBy=“客户”)
私人上市产品;
}
儿童班:
@实体
公共类产品{
@身份证
私有整数pid;
私有字符串pname;
@manytone(fetch=FetchType.LAZY)
@NotFound(action=NotFoundAction.IGNORE)
@JoinColumn(name=“fk\u cust\u id”)
私人客户;
}

@NotFound(action=NotFoundAction.IGNORE)
导致对
@manytone(fetch=FetchType.LAZY)
字段的急切加载

您使用什么hibernate版本?Spring boot with data jpa,Spring boot-2.0.1.RELEASE