List of usage examples for org.springframework.jdbc.datasource.lookup MapDataSourceLookup MapDataSourceLookup
public MapDataSourceLookup(Map<String, DataSource> dataSources)
From source file:org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.java
/** * Specify the JDBC DataSources that the JPA persistence provider is supposed * to use for accessing the database, resolving data source names in * {@code persistence.xml} against Spring-managed DataSources. * <p>The specified Map needs to define data source names for specific DataSource * objects, matching the data source names used in {@code persistence.xml}. * If not specified, data source names will be resolved as JNDI names instead * (as defined by standard JPA)./*from www . j a v a 2s .c o m*/ * @see org.springframework.jdbc.datasource.lookup.MapDataSourceLookup */ public void setDataSources(Map<String, DataSource> dataSources) { this.dataSourceLookup = new MapDataSourceLookup(dataSources); }