[ http://jira.jboss.com/jira/browse/JBAS-1296?page=comments#action_12314799 ] Alexey Loubyansky commented on JBAS-1296: -----------------------------------------
The bug is that the application should have failed to deploy as finders are allowed to return only the instances of the bean the finder is defined on. You should use ejbSelect instead. > EJB-QL CMR traversal returns wrong interface type > ------------------------------------------------- > > Key: JBAS-1296 > URL: http://jira.jboss.com/jira/browse/JBAS-1296 > Project: JBoss Application Server > Type: Bug > Components: CMP service, EJBs > Versions: JBossAS-4.0.1 Final, JBossAS-4.0.0 Final > Environment: Windows XP with JBoss 4.0.0 and JBoss 4.0.1 > Xdoclet, Eclipse 3.1 > Reporter: Wilson Pu > Assignee: Scott M Stark > Priority: Critical > > > // 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 > [EMAIL PROTECTED] > Software Developer > Vision Solutions Inc. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ JBoss-Development mailing list JBoss-Development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-development