【发布时间】:2016-11-08 16:02:56
【问题描述】:
我有 3 张桌子:
Item: item_id (pk), short_description, ...
SupplierItem: item_id (fk), supplier_id (fk), vendor_product_number, ...
Supplier: item_supplier (pk), name, ...
Item 和 Supplier 之间的关系是多对多的。供应商项目是
中间表。
我想使用 VO 和 DAO。
如何在 VO (Java) 中设计这个?
之后,如何在 java 代码中进行以下查询。
select i.item_id, i.short_description, s.vendor_product_number as FONUA_PRODUCT_CODE
from item i
left join supplier_item s
on i.item_id=s.item_id
where ((i.item_id=:item_id) OR :item_id IS NULL)
and i.parent_item_id is null
order by vendor_product_number DESC"
我还是不明白使用VO和DAO的概念。
谢谢
【问题讨论】: