Hello. How should I inject a custom DataSourceFactory? I have tried this, but it still try to use the DataSourceFactory in the model. This is going to have multiple ServerRuntimes - one for each database.
runtime = new ServerRuntime(“cayenne-mydomain.xml");
runtime.getInjector().injectMembers(new DataSourceFactory() {
@Override
public DataSource getDataSource(DataNodeDescriptor nodeDescriptor)
throws Exception {
return mything.getDataSource();
}
});
Regards,
Tore Halset.
