cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <>
Subject Re: QueryTable / Non-persisted DataObject [Was: Questions about Ordering, Optimistic Locking and QueryTable]
Date Tue, 20 May 2008 19:51:28 GMT
Well, the other thing you can do is work with Interfaces everywhere,
then create POJO classes implementing your interface for non-persisted
objects.   Don't know if that works any better for your particular
situation, though.

I've done this for a project with Cayenne, and I created cgen
templates to automatically create the interfaces as well as the
concrete Cayenne DataObject classes.  I also created POJO objects for
unit testing and data transfer objects using cgen templates.  The only
trick was handling reverse relationship setting in the base class of
the POJO objects, but it was doable.

On 5/20/08, Adrian Wiesmann <> wrote:
> On Mon, 19 May 2008 11:07:11 -0400
>  "Mike Kienenberger" <> wrote:
>  > I'm not really sure why you don't use a regular java bean object to do
>  > this.
> Because of the base class. I don't want to have my renderer check the
>  class to decide how to handle it. What I could try would be to subclass
>  from DataObject without having any info in the DataMap. Not sure how
>  Cayenne would like that though.
>  > However, I believe you could create a DataMap for all of these objects
>  > in a separate DataNode.   You don't have to create a table for them in
>  > the database.
> That could be a solution. Ugly, but still working.
>  > You might even be able to get away with having them in the same
>  > DataMap, provided you don't try to update/insert/delete them during a
>  > commit.   There's no requirement that you create an actual table on
>  > the database unless you execute sql accessing that table.
> Yes, I thought something like that. But still an ugly solution...
>  Cheers,
> Adrian

View raw message