Class SchemaDelegatingDataSource

java.lang.Object
org.springframework.jdbc.datasource.AbstractDataSource
com.broadleafcommerce.common.jpa.data.SchemaDelegatingDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource

public class SchemaDelegatingDataSource extends org.springframework.jdbc.datasource.AbstractDataSource implements DataSource
DataSource capable of delegating connection acquisition to another datasource, but performing connection initialization on retrieved connections before passing to the caller. The initialization specifically focuses on setting the default schema for the connection session. The assumption is that this datasource is backed by a common pool that generically targets a JDBC url without specifying schema information. This common pool can then be leveraged by multiple SchemaDelegatingDataSource instances, each targeting a different schema. This is primarily useful for uber installations that leverage multiple services in the same JVM using a higher level RoutableDataSource. See JpaDataRoute for more information.
Author:
Jeff Fischer