Re: Relationships Not Propagated

From: Jamie (jami..timulussoft.com)
Date: Sat Sep 19 2009 - 11:27:51 EDT

  • Next message: Jamie: "Re: Relationships Not Propagated"

    Nevermind... I figured it out. SQLResultSetMapping is now SQLResult.

    Jamie wrote:
    > Hi Michael
    >
    > Next question. I am trying to execute a query like:
    >
    > select distinct customer.companyName c, max(date) d from purchase
    > inner join customer on purchase.customerid = customer.id group by
    > customer.companyName"
    >
    > In doing so, I figured out I might need to use the SQLResultSetMapping
    > class to get at c and d, but this class does exist in the latest
    > cayenne-server-3.0M6.jar. What is the recommended approach?
    >
    > Thanks
    >
    > Jamie
    >
    >
    > Michael Gentry wrote:
    >> I took a quick look at your model and it looks OK (given what I know
    >> about what you are doing).
    >>
    >> One thing that may be worth trying is to change:
    >>
    >> Partner partner =
    >> ((BusinessServicesPrincipal)request.getUserPrincipal()).getPartner();
    >> DataContext context =
    >> ((BusinessServicesPrincipal)request.getUserPrincipal()).getDataContext();
    >>
    >> Customer customer = (Customer) context.newObject(Customer.class);
    >>
    >> to:
    >>
    >> Partner partner =
    >> ((BusinessServicesPrincipal)request.getUserPrincipal()).getPartner();
    >> Customer customer = partner.getDataContext().newObject(Customer.class);
    >>
    >> It may not solve anything, but worth a shot. I'm assuming you are
    >> using Cayenne 3.x?
    >>
    >

    -- 
    Stimulus Software - MailArchiva
    Email Archiving And Compliance
    USA Tel: +1-713-343-8824 ext 100
    UK Tel: +44-20-80991035 ext 100
    Email:  jami..timulussoft.com
    Web: http://www.mailarchiva.com
    To receive MailArchiva Enterprise Edition product announcements, send a message to: <mailarchiva-enterprise-edition-subscrib..timulussoft.com>
    



    This archive was generated by hypermail 2.0.0 : Sat Sep 19 2009 - 11:28:37 EDT