cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Huss <johnth...@gmail.com>
Subject Re: Is it possible/easy to integrate cayenne with other frameworks?
Date Thu, 08 Dec 2011 15:10:57 GMT
On Wed, Dec 7, 2011 at 2:11 AM, Kevin Meyer - KMZ <kevin@kmz.co.za> wrote:

> Dear John,
>
> Thanks for your response.
>
> On 6 Dec 2011 at 9:04, John Huss wrote:
>
> > You can use Cayenne without running the modeler, but it would be rather
> > cumbersome since you would have to create the whole model
> programmatically
> > at runtime each time.
>
> So Cayenne does not introspect the POJOs?
>
> I suppose I can work with having to run a config tool every now and
> then, as design changes need to be handled.
>
> > And normally you would generate custom classes for your Entities
> > (objects), but without having a pre-existing model you would just
> > have to use CayenneDataObject directly which will force you to
> > access values by name instead of via getters and setters. If those
> > requirements are acceptable, then it could work.
>
> Isis does not generate code - it uses the users POJOs as is, with extra
> methods or annotations to affect behaviour, visibility etc.
>
> I was hoping that I could merely require that Cayenne-managed
> POJOs extend a Cayenne-compatible base class, and no more, and
> that only getXXX/setXXX methods would be used to map XXX into the
> ORM. In Isis, a getXXX-only implies a read-only property, and setYYY
> only is for injecting services. Neither of which are passed to the Isis
> ORM.
>

You could probably reverse-engineer a model by introspecting specific
classes, but you would have to make assumptions about the database mapping
information (jdbc type, width, scale precision) unless that is available
via annotations in your classes.

>
> > The "update" method might be tricker.  Cayenne saves all changes to the
> > entire object graph at once; you can't just save one object, you save all
> > changes to the related objects that are loaded and modified.  If this is
> > different than the "update" concept in Isis then it may be a problem.
>
> No problem - Isis does something similar. If an object is transient, all
> properties are "walked" and persisted. But objects in the entire graph
> are not persisted if they have not changed.
>
> Regards,
> Kevin
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message