关联了阿
在ParentVO.class中加入了private Set child=new HashSet();
在ChildVO.class 中加入了private ParentVO parentVo;

解决方案 »

  1.   

    主要是update的时候问题很明显
    如果我执行session.update(parent2);
    就会执行这个语句
     update parent set name=?, sex=? where id=?
     update child set parentId=null where parentId=?
    其实我并不想把child表的parentId设为空 而是想保留原有parentId,将parent表中改动的name和addr更新到child表对应的parentNm,parentAddr字段值中
      

  2.   

    inverse="true"的时候 就无法实现当update parent表的时候同时更新child表
      

  3.   

    在《child.hbm.xml》
            <many-to-one name="parentVo" 
                column ="parentId" 
                cascade="none"
                class="test.testHibernate.ParentVO"/> 
    我觉得该是你这里的vascade属性出问题了。