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.

On Saturday, December 10, 2011, Kevin Meyer - KMZ <ke...@kmz.co.za> wrote:
> On 8 Dec 2011 at 16:18, Andrus Adamchik wrote:
>
>>
>> In the custom module define DataDomain loading services to
>> reverse-engineer the POJOs instead of loading mapping from XML. This
>> is the biggest task, requiring some understanding of Cayenne APIs.
>> Feel free to ask here if you get stuck with anything. Also map
>> SchemaUpdateStrategy to CreateIfNoSchemaStrategy that will create a
>> DB schema based on your mapping.
>
> Ok!
>
> I've decided to first try re-implementing a new Isis ObjectStore (which
> has a bespoke Isis Persistence API) before writing a whole new Isis
> Context which is independent of the Persistence API.
>
> Anyway.
>
> I now have my empty project, Isis has been told about a new
> ObjectStore (CayenneObjectStore), and in the
> CayenneObjectStore#open() method, I have created a runtime and a
> context. I also have a custom Module to inject my helpers.
>
> Of course, when I try create an object:
> Object o = context.newObject(persistentClass);
> I get an exception of:
> Class is not mapped with Cayenne: isis.persistor.SimpleClassA
> which is to be expected.
>
> So!
>
> I expect I need to provide a custom binder for EntityResolver?
>
> I'm trying:
>        binder.bind(EntityResolver.class).toInstance(
>        new IsisEntityResolver());
>
> in my custom module, but its not being picked up in the DataContext.
>
> But I can inject it manually:
>        DataContext dc = (DataContext) context;
>        dc.setEntityResolver(new IsisEntityResolver());
>
> Nevermind.
>
> What are the basics of defining DataDomain loading services to
> reverse-engineer the POJOs ?
>
> I already have the list of domain entities and their properties (from
> Isis)...
>
>
> Regards,
> Kevin
>
>

Reply via email to