一个企业公司的组织关系用树形图表示。界面查询我是用的是struts1,
用${org.parent.name }来查询父组织的名称,
然后查询报错:
org.hibernate.ObjectNotFoundException: No row with the given identifier exists:我自己的思考是:一开始添加数据T_Organization表中数据为空,第一条数据的pid为空,然后这时候查询这第一条记录的父组织的名称时,就会报错。
struts1中有这样的问题吗?请大虾赐教。
Organization.hbm.xml配置文件:
<hibernate-mapping>
  <class table="T_Organization" name="com.lzq.model.Organization">
    <id access="field" name="id">
      <generator class="native"/>
    </id>
    <property name="name" access="field"/>
    <property name="description" access="field"/>
    <property name="sn" access="field"/>
    <many-to-one column="pid" access="field" name="parent"/>
    <set access="field" lazy="extra" inverse="true" name="children">
      <key column="pid"/>
      <one-to-many class="com.lzq.model.Organization"/>
    </set>
  </class>
</hibernate-mapping>