cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tore Halset <hal...@pvv.ntnu.no>
Subject inject DataSourceFactory
Date Mon, 18 Aug 2014 14:15:13 GMT
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.
Mime
View raw message