在Peoletable.hbm.xml加上cascade="save-update" 

解决方案 »

  1.   

    <set name="computertables" inverse="true" cascade="all" > 
                 <key > 
                     <column name="people" not-null="true" / > 
                 </key > 
                 <one-to-many class="com.hibernate.Computertable" / > 
             </set > 
      

  2.   

    <set name="computertables" inverse="false" cascade="all" > 
                 <key > 
                     <column name="people" not-null="true" / > 
                 </key > 
                 <one-to-many class="com.hibernate.Computertable" / > 
             </set >