errors

2012-04-02 Thread ADAMA COULIBALY
Hi I am new to cayenne and I built my project. I get the following error: Exception in thread "main" java.lang.IllegalArgumentException: Class is not mapped with Cayenne: org.example.cayenne.persistent.Student at org.apache.cayenne.access.DataContext.newObject(DataContext.java:689) at org.example.c

Re: select over PKs

2012-04-02 Thread gilbertoca
Sheldon wrote > > If I specify a pageSize than I get any PK of objects. > I want, that I know a list of PKs and get their Objects. > > Sheldon > You can add a NamedQuery[1] in the modeler, for example: Then [2]:

RE: lazy loading (slightly OT but still pretty important)

2012-04-02 Thread Durchholz, Joachim
>>> You have to inflate your cache anew from DB in every transaction. >>> You don't have any data when you start. >> >> Sure, that's unavoidable if you want to do optimistic locking. > > You can do optimistic locking with cached data just as well. It > doesn't have to come from the same transactio

Re: DataContexts mixed

2012-04-02 Thread Bruno René Santos
Hello Aristedes, I have just found out the problem I had two DataObjects, one inherited from other but with no other difference. So Cayenne got confused and gave me versions of the same object on the Parent object and also in the Child Object on different contexts. The child was from the conte

Re: select over PKs

2012-04-02 Thread Aristedes Maniatis
On 2/04/12 5:49 PM, Sheldon wrote: If I specify a pageSize than I get any PK of objects. I want, that I know a list of PKs and get their Objects. I suspect that the suggestion here is to think about using Cayenne in a different way. What you are trying to do often suggests that you are working

Re: lazy loading (slightly OT but still pretty important)

2012-04-02 Thread Andrew Lindesay
Hi Sheldon; You can just create an EJBQLQuery that extracts those specific columns (expressed as entity attributes' names) and then run the query and you'll pull back that data. A crude example of such a query; "SELECT o." + Foo.CODE_PROPERTY+" FROM "+Foo.class.getSimpleName()+" o WHERE o."

Re: lazy loading (slightly OT but still pretty important)

2012-04-02 Thread Sheldon
What I mean is, if I have a Table with n columns (col1, col2, col3 ...) and want load only the value of col1 and col3 (without loading col2 and the others). Is this example possible? Sheldon -- View this message in context: http://cayenne.195.n3.nabble.com/lazy-loading-tp3863908p3877037.html

Re: select over PKs

2012-04-02 Thread Sheldon
If I specify a pageSize than I get any PK of objects. I want, that I know a list of PKs and get their Objects. Sheldon -- View this message in context: http://cayenne.195.n3.nabble.com/select-over-PKs-tp3870305p3876993.html Sent from the Cayenne - User mailing list archive at Nabble.com.