1.数据表:
orders:订单表 customer:客户表
orders:
id int(4)
orderno varchar(20)
moeny decimal(10,2)
customer_id int(4)
customer:
id int(4)
name varchar(20)
phone varchar(20)
2.pojo类
public class Customer implements Serilizable{
private Integer id;
private String name;
private String phone;
private Set orders=new hashSet();
public Customer(){
}
}
public class Orders implements Serilizable{
private Integer id;
private String orderno;
private Double moeny;
private Customer customer;
public Orders(){
}
}
3.hbm.xml
Orders.hbm.xml
Customer.hbm.xml
posted on 2008-05-25 17:10 林的 阅读(527) 评论(0) 编辑 收藏 所属分类: hibernate