Yeah, the example is probably very dated. I don't have a full example, but I 
would start with reading about Cayenne DI and container customization in 
cayenne-guide.pdf included in the release, and then redefine DataMapLoader 
service provided in org.apache.cayenne.configuration.server.ServerModule to use 
your own loader that creates a DataMap on the fly. Here is how that looks in 
ServerModule:

binder.bind(DataMapLoader.class).to(XMLDataMapLoader.class);

Instead of XMLDataMapLoader, you'd provide your own DataMapLoader 
implementation.

Cheers,
Andrus


On Aug 16, 2012, at 9:36 PM, David Enrique García Romo wrote:

> I have tried to implement a Programatically configuration for Cayenne (I am
> using Cayenne 3.1). I have read and tried the No Xml example
> unsuccessfully, i think cause the example works only with Cayenne 3.0 and
> not with 3.1. And i see other threads but I don't undestand how implement
> it with DI Injection. Some quick example will be grateful.
> 
> My first attempt fail with some Exceptions but it is based in No Xml
> Example.

Reply via email to