Fetching and processing a large amount of objects

2012-12-12 Thread Simon Schneider
Hi list, my task is to fetch and process a large amount of objects. Reading the documentation my best choice seemed to do a dataContext.performIteratedQuery(query). The problem is that I get a Java Heap Space error, on executing this statement. Now it seems to me the problem is that

Re: Fetching and processing a large amount of objects

2012-12-12 Thread Michael Gentry
Hi Simon, some questions: 1) How many records are you talking about? 2) Are you updating your object with a flag/etc you can query on again later (to exclude objects you've already processed)? 3) What version of Cayenne are you using and what database? 4) When you convert your Map (from the

Re: Problem in fetching the data from multiple tables with relationships.

2012-12-12 Thread John Huss
I'm not really sure what your question is. Cayenne will fetch all of the fields that are modeled and turn them into objects. And you can add prefetching paths to your SelectQuery to pre-fetch the related objects, otherwise they will be loaded when accessed. If you want to write your own SQL and

Re: Fetching and processing a large amount of objects

2012-12-12 Thread Aristedes Maniatis
On 13/12/12 12:18am, Simon Schneider wrote: Hi list, my task is to fetch and process a large amount of objects. Reading the documentation my best choice seemed to do a dataContext.performIteratedQuery(query). The problem is that I get a Java Heap Space error, on executing this statement. Now

RE: Problem in fetching the data from multiple tables with relationships.

2012-12-12 Thread Sampath Uppula
Hi John, Thanks for the reply. For the below query, can you provide a sample using SQLTemplate? 1. how to use the SQLTemplate to execute the below query? SELECT um.ID, um.FIRST_NAME, um.LAST_NAME, ua.ROLE_ID, tt.TASK_ASSIGNED_DATE, tt.TASK_CLOSED_DATE,

Re: Problem in fetching the data from multiple tables with relationships.

2012-12-12 Thread Aristedes Maniatis
If you really want to use Cayenne for the power it gives you, rather than writing SQL, I recommend you work your way through the tutorials. Yes, you can use SQLTemplate. No, that's probably not what you want to do here. At its heart, your query is just um.ID = 112. Start by making that work in