<class name="Customer,DomainModel" table="Customer">
<id name="CustomerId" column="CustomerId" type="Int32" unsaved-value="0">
<generator class="native"></generator>
</id>
<property name="Firstname" column="Firstname" type="string" length="50" not-null="false"></property>
<property name="Lastname" column="Lastname" type="string" length="50" not-null="false"></property>
<bag name="Orders" table="[Order]" generic="true" inverse ="false" cascade ="All" >
<key column="Customer"/>
<span style="color: #ff0000;"> <!--这里面 one-to-many 和 composite-element都能实现一对多,他们之间有什么区别--></span>
<one-to-many class="DomainModel.Entities.Order,DomainModel" />
<!--composite-element class="DomainModel.Entities.Order,DomainModel">
<parent name="Customer"/>
<property name="OrderId" column="OrderId" type="Int32"/>
<property name="OrderDate" column ="OrderDate" type="DateTime" not-null="false"/>
</composite-element-->
</bag>
</class>
慕盖茨4494581
一只甜甜圈
相关分类