我有表 Order(orderno,orderdate,suppid) Supplier(suppid,suppname) orderdetails(orderdetailid,orderno) 如何使用 JPA orderno,orderdate,suppname,orderdetailid 获得这样的结果?
问问题
96 次
1 回答
0
@ManyToOne
@Fetch(FetchMode.JOIN)
@JoinColumn(name="suppid",nullable=false,insertable=false,updatable=false)
private Supplier supplierDetails;
This will Join one table to another and fetch the record for you.This code should be inside Order table POJO. and getter setter of supplier details as well.
于 2013-09-17T10:23:38.567 回答