比如有3个bean :Order , OderPro, Product
其中Order的Id关联OrderPro的orderId, Product的Id关联OrderPro的proId,
获取Order对象的时候 orderList = dao().fetchLinks(orderList, "orderProduct");
怎么做可以让order对象里的orderPro对象关联上对应的Product
@Table("user_order")
public class UserOrder extends BaseBean{
private static final long serialVersionUID = 1L;
@Id
private Long Id;
@Many(target = UserOrderPro.class, field = "orderId")
private List<UserOrderPro> orderProduct;
}
@Table("user_order_pro")
public class UserOrderPro extends BaseBean{
private static final long serialVersionUID = 1L;
@Id
private Long Id;
@Column("order_id")
private Long orderId;
@One(target = Product.class, field = "proId")
private Product pro;
}
@Table("product")
public class Product extends BaseBean{
private static final long serialVersionUID = 1L;
@Id
private Long Id;
@Column("order_id")
}