Menu

#2258 EJB-QL CMR traversal returns wrong interface type

v4.0
closed-rejected
nobody
5
2005-01-18
2005-01-18
wilsonpu
No

Hello,
JBOSS AS 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. Codes are attached to ease table data
creatation.

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. (codes are attached)

Base on the finder method, we are expecting to return a
collection of LineItemLocal interface. However, we got
CustomerLocal interface instead.

The codes are attached with DB data. However, you will
have to separate the codes to different file.

Wilson Pu
wpu@visionsolutions.com
Software Developer
Vision Solutions Inc.

Discussion

  • wilsonpu

    wilsonpu - 2005-01-18

    codes and test data

     
  • Scott M Stark

    Scott M Stark - 2005-01-18
    • status: open --> closed-rejected
     
  • Scott M Stark

    Scott M Stark - 2005-01-18

    Logged In: YES
    user_id=175228

    All issues have been moved to http://jira.jboss.com. Existing
    issues have been moved. New issues will be closed with this
    canned reponse.

     

Log in to post a comment.