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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.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
Hibernate 在self表中休眠@MapKey_Hibernate_Collections_Map_Mapping - Fatal编程技术网

Hibernate 在self表中休眠@MapKey

Hibernate 在self表中休眠@MapKey,hibernate,collections,map,mapping,Hibernate,Collections,Map,Mapping,我有一个要求,即实体对象需要有一个MapKey为同一表中的列的Map集合。实体对象基金可以有相关的基金,每个基金都有一个唯一的基金类型。我需要有一个地图,其中FundType是一个枚举类相关的资金。Hibernate没有将相关资金持久化到表中。只有母基金被插入。这是我的实体对象,用于相同的: @实体 @表(name=“信托基金”) 公营基金{ @身份证 @生成值 保护长id; @列(name=“基金类型”,null=false) @枚举(EnumType.STRING) 保护基金类型基金类型;

我有一个要求,即实体对象需要有一个MapKey为同一表中的列的Map集合。实体对象基金可以有相关的基金,每个基金都有一个唯一的基金类型。我需要有一个地图,其中FundType是一个枚举类相关的资金。Hibernate没有将相关资金持久化到表中。只有母基金被插入。这是我的实体对象,用于相同的:

@实体
@表(name=“信托基金”)
公营基金{
@身份证
@生成值
保护长id;
@列(name=“基金类型”,null=false)
@枚举(EnumType.STRING)
保护基金类型基金类型;
@OneToMany(mappedBy=“mainFund”,cascade={CascadeType.ALL})
@MapKey(name=“fundType”)
受保护的地图相关基金;
@manytone(targetEntity=FundImpl.class,cascade={CascadeType.ALL})
保护基金;
@列(name=“FULL_name”,nullable=false,length=255)
受保护字符串全名;
}