Package org.springframework.jdbc.datasource.lookup

Examples of org.springframework.jdbc.datasource.lookup.MapDataSourceLookup


   * If not specified, data source names will be resolved as JNDI names instead
   * (as defined by standard JPA).
   * @see org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
   */
  public void setDataSources(Map<String, DataSource> dataSources) {
    this.dataSourceLookup = new MapDataSourceLookup(dataSources);
  }
View Full Code Here


  public void testExampleComplex() throws Exception {
    DataSource ds = new DriverManagerDataSource();

    String resource = "/org/springframework/orm/jpa/persistence-complex.xml";
    MapDataSourceLookup dataSourceLookup = new MapDataSourceLookup();
    Map<String, DataSource> dataSources = new HashMap<String, DataSource>();
    dataSources.put("jdbc/MyPartDB", ds);
    dataSources.put("jdbc/MyDB", ds);
    dataSourceLookup.setDataSources(dataSources);
    PersistenceUnitReader reader = new PersistenceUnitReader(
        new PathMatchingResourcePatternResolver(), dataSourceLookup);
    PersistenceUnitInfo[] info = reader.readPersistenceUnitInfos(resource);

    assertEquals(2, info.length);
View Full Code Here

   * If not specified, data source names will be resolved as JNDI names instead
   * (as defined by standard JPA).
   * @see org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
   */
  public void setDataSources(Map<String, DataSource> dataSources) {
    this.dataSourceLookup = new MapDataSourceLookup(dataSources);
  }
View Full Code Here

   * If not specified, data source names will be resolved as JNDI names instead
   * (as defined by standard JPA).
   * @see org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
   */
  public void setDataSources(Map<String, DataSource> dataSources) {
    this.dataSourceLookup = new MapDataSourceLookup(dataSources);
  }
View Full Code Here

   * If not specified, data source names will be resolved as JNDI names instead
   * (as defined by standard JPA).
   * @see org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
   */
  public void setDataSources(Map<String, DataSource> dataSources) {
    this.dataSourceLookup = new MapDataSourceLookup(dataSources);
  }
View Full Code Here

   * If not specified, data source names will be resolved as JNDI names instead
   * (as defined by standard JPA).
   * @see org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
   */
  public void setDataSources(Map<String, DataSource> dataSources) {
    this.dataSourceLookup = new MapDataSourceLookup(dataSources);
  }
View Full Code Here

   * If not specified, data source names will be resolved as JNDI names instead
   * (as defined by standard JPA).
   * @see org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
   */
  public void setDataSources(Map<String, DataSource> dataSources) {
    this.dataSourceLookup = new MapDataSourceLookup(dataSources);
  }
View Full Code Here

  @Test
  public void testExampleComplex() throws Exception {
    DataSource ds = new DriverManagerDataSource();

    String resource = "/org/springframework/orm/jpa/persistence-complex.xml";
    MapDataSourceLookup dataSourceLookup = new MapDataSourceLookup();
    Map<String, DataSource> dataSources = new HashMap<String, DataSource>();
    dataSources.put("jdbc/MyPartDB", ds);
    dataSources.put("jdbc/MyDB", ds);
    dataSourceLookup.setDataSources(dataSources);
    PersistenceUnitReader reader = new PersistenceUnitReader(
        new PathMatchingResourcePatternResolver(), dataSourceLookup);
    PersistenceUnitInfo[] info = reader.readPersistenceUnitInfos(resource);

    assertEquals(2, info.length);
View Full Code Here

   * If not specified, data source names will be resolved as JNDI names instead
   * (as defined by standard JPA).
   * @see org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
   */
  public void setDataSources(Map<String, DataSource> dataSources) {
    this.dataSourceLookup = new MapDataSourceLookup(dataSources);
  }
View Full Code Here

   * If not specified, data source names will be resolved as JNDI names instead
   * (as defined by standard JPA).
   * @see org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
   */
  public void setDataSources(Map<String, DataSource> dataSources) {
    this.dataSourceLookup = new MapDataSourceLookup(dataSources);
  }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.datasource.lookup.MapDataSourceLookup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.