1
我想在表EmployeebyProject中插入一個insert,當試圖插入時拋出瞬態對象異常。NHibernate瞬態對象異常
表EmployeebyProject:{PK:僱員,PK:專案編號,DateBegin,DateEnd}
這是映射:
<composite-id>
<key-many-to-one name="Project" column="ProjectId" class="Project" cascade="save"></key-many-to-one>
<key-many-to-one name="Employee" column="EmployeeId" class="Employee"></key-many-to-one>
</composite-id>
<property name="DateBegin" type="DateTime"/>
<property name="DateEnd" type="DateTime"/>
enter code here
如何可以避免這個問題?
我保存員工之前,級聯=「保存」,但不工作... – ale