我在页面调用返回List对象的Action,但是会报错啊,
Hibernate: select country0_.Id as Id101_, country0_.Name as Name101_, country0_.EnName as EnName101_ from Country country0_
2006-11-15 16:57:18,671[ WARN]- Unhandled Exception thrown: class org.springframework.orm.hibernate3.HibernateSystemException只是想返回Country表的数据集合(List),Country表有子表,在映射文件中使用了双向关联的代码:
<set name="provinceList" table="Province" lazy="true" cascade="none" inverse="true" >
<key column="CountryId"/>
        <one-to-many class="com.goo.datamodule.po.bs.Province" />
</set>求哪位大大帮解决一下啊!!

解决方案 »

  1.   

    就你写出来的看,问题不在关联(生成的sql与关联无关),而是其它的问题
      

  2.   

    我自己估计是Hibernate映射文件的问题,但是看了半天看不出来啊~~~
    Country.hbm.xml内容:<!--
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
            "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <class lazy="false" name="com.goo.datamodule.po.bs.Country" table="Country">
    <id name="id" type="string" unsaved-value="null">
    <column name="Id"/>
    <generator class="uuid.hex"/>
    </id>
    <property name="name" column="Name" type="string"/>
    <property name="enName" column="EnName" type="string"/>
    <set name="provinceList" table="Province" lazy="true" cascade="none" inverse="true" >
    <key column="CountryId"/>
            <one-to-many class="com.goo.datamodule.po.bs.Province" />
        </set>
    </class>
    </hibernate-mapping>
    -->