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