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: Cayenne and Spring (a Hibernate inspired question)

2008-02-27 Thread Michael Gentry
When I used Cayenne with a Tapestry application, I stored a DataContext off in the session (so it was persistent across request/response loops) and I could use it to handle objects I needed to track from page-to-page (or even to the same page, but in a different request/response loop). This is wha

Re: Cayenne and Spring (a Hibernate inspired question)

2008-02-27 Thread Robert Zeigler
I've personally avoided Hibernate, so I can't speak to the spring/ hibernate stuff, sorry. For sorting across multiple relationships, if you want to do it in- memory, you can always use cayenne's "Ordering". You can add multiple orderings to any particular query, and you can also use multiple

RE: Cayenne and Spring (a Hibernate inspired question)

2008-02-27 Thread Kevin Menard
Hi Marek, My Hibernate experience is limited to a single project that did not use Spring, so it's hard for me to draw a fair comparison. My take from passively watching on discussion lists (particularly the Tapestry one) is that Spring makes Hibernate usable in a way that Cayenne is out of the bo