我正在使用jpa并独立创建sql而不自动生成sql, 有三个村庄,人口和村庄人口,其中village_population持有地图。
我的实体映射是这样的
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "village_population", joinColumns = @JoinColumn(name = "village_id"),
uniqueConstraints = @UniqueConstraint(columnNames = {"village_id","population_id"}))
@Column(name = "population_id")
private final Set<String> populationIds = new HashSet<String>();
添加子进程时的合并工作正常但更新不起作用,当查看sql日志时,它只显示更新查询并插入村表的查询并插入查询集合表(village_population)但不在village_population上运行更新查询< / p>