Re: Cayenne and Spring (a Hibernate inspired question)

2008-02-28 Thread Michael Gentry
It is my experience that Cayenne handles lazy relationships (faults) very well -- just keep your objects/data context/etc around. As soon as a fault is triggered, Cayenne will get a (pooled) connection to the database, do what it needs, then return the connection. When I was subscribed to the Tap

Re: Cayenne and Spring (a Hibernate inspired question)

2008-02-28 Thread Andrus Adamchik
It should work... Just to be sure I tried it on MySQL 5. It works: 1. One-to-many OUTER JOIN: mysql> select t0.artist_id, t1.painting_title FROM artist t0 left join painting t1 on t0.artist_id = t1.artist_id order by t1.PAINTING_TITLE; +---++ | artist_id | painting_

Re: Cayenne and Spring (a Hibernate inspired question)

2008-02-28 Thread Marek Wawrzyczny
Thanks Marcin and Andrus, Andrus, are you sure that the problem Marcin is describing can be solved? I thought that something like: SELECT t1.id, t1.a, t1.t2_fk, t2.id, t2.x FROM table1 AS t1 LEFT JOIN table2 AS t2 ON t2.id = t1.t2_fk ORDER BY t2.x would never return results from t1 that do not

Re: Cayenne and Spring (a Hibernate inspired question)

2008-02-28 Thread Andrus Adamchik
3.0 EJBQLQuery should be able to handle that. Andrus On Feb 28, 2008, at 2:44 PM, Marcin Skladaniec wrote: Hi Short comment on the cayenne sorted queries, they work great but be aware of a limitation: (the query examples assume one to many relation Artist-Painting) SelectQuery query = ne

Re: Cayenne and Spring (a Hibernate inspired question)

2008-02-28 Thread Marcin Skladaniec
Hi Short comment on the cayenne sorted queries, they work great but be aware of a limitation: (the query examples assume one to many relation Artist-Painting) SelectQuery query = new SelectQuery(Painting.class); query.addOrdering(Painting.ARTIST_PROPERTY+"."+Artist.LAST_NAME,true); will not r

Re: Cayenne and Spring (a Hibernate inspired question)

2008-02-28 Thread Marek Wawrzyczny
Thanks Kevin, Your response was quite encouraging. Most of the pages are very simple but there is one or two which enforces quite coplex workflow. It's a perfect candidate for a child context. Just out of curiosity, how do people manage contexts in a typical CRUD application containing several

Re: Cayenne and Spring (a Hibernate inspired question)

2008-02-28 Thread Malcolm Edgar
Another thing to consider is whether you want to serialize the object graph in the session. Another approach is to write it to the database, and have a status column in the parent object. When the final page "submit" is performed, the status column is flipped to invoke the business process. Using

Re: on hibernate vs. cayenne

2008-02-28 Thread Malcolm Edgar
Hi Robert, Cayenne gives you a little more information that Hibernate, it that you can get all the DbAttributes assocated with an CayenneObject, e.g. the maximum string/varchar length. If you are doing very generic code, it can be useful to add a public accessor method to get at the internal Caye