cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jamie <ja...@stimulussoft.com>
Subject Re: Relationships Not Propagated
Date Sat, 19 Sep 2009 14:56:31 GMT
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?
>   


Mime
View raw message