@Test public void testDataSources() { Map<String, DataSource> dss = cayenneService.dataSources(); assertEquals(2, dss.size()); assertSame(ds1, dss.get("dn1")); assertSame(ds2, dss.get("dn2")); }
@Override public Map<String, DataSource> dataSources() { Map<String, DataSource> dataSources = new HashMap<>(); for (DataNode n : runtime.getDataDomain().getDataNodes()) { dataSources.put(n.getName(), n.getDataSource()); } return dataSources; }
TargetCayenneService implements ITargetCayenneService { @Override public Map<String, DataSource> dataSources() { Map<String, DataSource> dataSources = new HashMap<>(); for (DataNode n : runtime.getDataDomain().getDataNodes()) { dataSources.put(n.getName(), n.getDataSource()); } return dataSources; } }
TargetCayenneService implements ITargetCayenneService { @Override public Map<String, DataSource> dataSources() { Map<String, DataSource> dataSources = new HashMap<>(); for (DataNode n : runtime.getDataDomain().getDataNodes()) { dataSources.put(n.getName(), n.getDataSource()); } return dataSources; } TargetCayenneService(ServerRuntime runtime); }
TargetCayenneService implements ITargetCayenneService { @Override public Map<String, DataSource> dataSources() { Map<String, DataSource> dataSources = new HashMap<>(); for (DataNode n : runtime.getDataDomain().getDataNodes()) { dataSources.put(n.getName(), n.getDataSource()); } return dataSources; } TargetCayenneService(ServerRuntime runtime); @Override Map<String, DataSource> dataSources(); @Override ObjectContext newContext(); @Override EntityResolver entityResolver(); }
TargetCayenneService implements ITargetCayenneService { @Override public Map<String, DataSource> dataSources() { Map<String, DataSource> dataSources = new HashMap<>(); for (DataNode n : runtime.getDataDomain().getDataNodes()) { dataSources.put(n.getName(), n.getDataSource()); } return dataSources; } TargetCayenneService(ServerRuntime runtime); @Override Map<String, DataSource> dataSources(); @Override ObjectContext newContext(); @Override EntityResolver entityResolver();  }