Details
-
Bug
-
Resolution: Done
-
Major
-
JBossAS-4.0.0 Final, JBossAS-4.0.1 Final
-
None
Description
// Same bug posted on SourceForge with attachment
Hello,
JBOSS App. Srv. returns/contains wrong interface type with CMR traversal using EJB-QL. We recreated the line item example from Mastering EJB Appendix D on EJB-QL entity bean relationship traversal (page 574).
Test case below.
We created 3 tables:
Customer
---------
customerId (pk)
name
Order
---------
orderId (pk)
customerId (fk)
date
LineItem
---------
lineItemId (pk)
orderId (fk)
sku
quantity
On the CustomerBean, we defined a finder method using Xdoclet.
@ejb.finder
signature="Collection
findCustomerLineItems(int customerId)"
unchcked="true"
query="SELECT OBJECT(l) FROM Customer AS c,
IN(c.orders) o, IN (o.lineItems) l WHERE c.customerId=?1"
result-type-mapping="Local"
We also defined CMR for getting the orders from the customer bean and getting the lineitems from the order bean.
Base on the finder method, we are expecting to return a collection of LineItemLocal interface. However, we got CustomerLocal interface instead.
Wilson Pu
wpu@visionsolutions.com
Software Developer
Vision Solutions Inc.