cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@gmail.com>
Subject Re: Is it possible/easy to integrate cayenne with other frameworks?
Date Mon, 12 Dec 2011 02:18:05 GMT
I don't really know what you're doing, but what about something like this:

class POJO {
    CayenneDataObject delegate;

    public POJO() {
    }

    public setDelegate(CayenneDataObject cdo) {
         this.delegate = cdo;
    }

// or

    public POJO(CayenneDataObject cdo) {
         this.delegate = cdo;
    }

// for each attribute (and similar for each relationship)

    public type getX() {
        return delegate.readProperty("x");
    }

    public void setX(type x) {
         writeProperty("x", x);
    }
}



On Sun, Dec 11, 2011 at 11:38 AM, Kevin Meyer - KMZ <kevin@kmz.co.za> wrote:
> Thanks - I've got to the point where Cayenne is trying to instantiate an
> instance of one of my pojos, but I've run into a problem...
>
> Cayenne *requires* the pojo to implement the Persisted interface, but
> this interface kills the Isis introspector (it detects the XMLSerializer,
> which contains a Collections parameter, which is not supported).
>
> I'm looking into how to wrap the Isis user Pojo (which does not *have*
> to implement any interface or extend any class), into something that
> Cayenne can instantiate.
>
> Any ideas?
>
> Regards,
> Kevin
>
>
>
>> So what do your pojos (entity classes) look like?  Like andrus said,
>> typically these have a specific implementation for cayenne.  If you just
>> have plain fields with fetters and setters then you will need some custom
>> logic to make cayenne work with them.
>>
>> For creating the model you need to do new DataMap and then add new DbEntity
>> instances and ObjEntity instances and DbAttribute and ObjAttribute
>> instances need to be added to each and relationships etc. the Db* types
>> need to be connected to the Obj* types.
>

Mime
View raw message