标签:
public class Order {
private Integer orderId;
private String orderName;
private Customer customer;
}
public class Customer {
private Integer customerId;
private String sustomerName;
}
在映射多对一的关联关系时,使用 many-to-one 来映射多对一的关联关系。
<many-to-one name="customer" class="Customer" column="CUSTOMER_ID"></many-to-one>
name : 是一这一端中对应的多的那一端的 名字。
class :是一那一端的属性对应的类名。
column :是一那一端在多的一端对应的数据表中的外键的名字。
标签:
原文地址:http://www.cnblogs.com/j05ahua/p/5785146.html