Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1296

EJB-QL CMR traversal returns wrong interface type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBossAS-4.0.4.GA
    • JBossAS-4.0.0 Final, JBossAS-4.0.1 Final
    • CMP service, EJB2
    • 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.

      Attachments

        Activity

          People

            olubyans@redhat.com Alexey Loubyansky
            wilsonpu Wilson Pu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: