Now I am working for reporting requirements, where I want to fetch the data from multiple tables and relationships between them are one-to-one and one-to-many and many-to-many. If we use 'SelectQuery' or 'SQLTemplate' the output is list<Root> objects. Using the root object we can fetch the references data that may be a List or an Object.
Here the problem is, for one root object there is list of child objects. In my output, I have to create a new row for every child object with all other root and child objects. Can anybody suggest a solution using cayenne? I completely struck... not getting idea how to implement this? Thanks, Sampath Uppula. -----Original Message----- From: Aristedes Maniatis [mailto:[email protected]] Sent: Friday, December 14, 2012 3:50 PM To: [email protected] Subject: Re: Problem in fetching the data from multiple tables with relationships. On 13/12/12 7:32pm, Sampath Uppula wrote: > Please look at the following solution... I had implemented for similar > scenario. > In the below code, I am able to fetch all the data from the relationships > tables. But the problem is I am forced to hardcode the return types > (List<Role> List<LOB> ...). > Because of that I am not able to develop a strategic solution. > > In other words the requirement is, > Depends on the requirement, columns in the criteria and columns in the fetch > will be different. How can I achieve this using cayenne? > Hope you understand my problem now. Not really. You asked for a solution to a problem which was fetching data and following relations. Note that your prefetches are not needed, they are only a way to improve performance in some situations. Nothing in Cayenne forces you to specify the specific entity in the generics. You can treat the List as <PersistentObject> and handle it how you choose. Ari -- --------------------------> Aristedes Maniatis GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A ============================================================================================================================Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/tim/disclaimer.html">http://tim.techmahindra.com/tim/disclaimer.html</a> internally within Tech Mahindra.============================================================================================================================
