我有下一个代码
getEntityManager().persist(country.getCity().getClinic().getPatient());
并在日志中查看下一个sql
Hibernate:
select
next value for patient_seq
from
dual_patient_seq
Hibernate:
select
next value for clinic_seq
from
dual_lclinic_seq
Hibernate:
select
next value for city_seq
from
dual_city_seq
但是没有生成“国家/地区”的序列。所有XML都没问题。 Whan是问题吗?
答案 0 :(得分:0)
<set name="countrysPersistent" lazy="true" inverse="true" >
<key column="country" />
<one-to-many class="Country" />
</set>
到
<set name="countrysPersistent" lazy="true" inverse="true" cascade="all">
<key column="country" />
<one-to-many class="Country" />
</set>
,这很有用!