rs.data.hibernate.util.DataSourceConnectionProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of data-hibernate Show documentation
Show all versions of data-hibernate Show documentation
Hibernate extension for Data Access classes
package rs.data.hibernate.util;
import javax.sql.DataSource;
import org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider;
/**
* Inject the data source
* @author ralph
*
*/
public class DataSourceConnectionProvider extends InjectedDataSourceConnectionProvider {
private static DataSource myDatasource;
/**
* Constructor.
*/
public DataSourceConnectionProvider() {
}
/**
* {@inheritDoc}
*/
@Override
public DataSource getDataSource() {
return getMyDatasource();
}
/**
* Returns the myDatasource.
* @return the myDatasource
*/
public static DataSource getMyDatasource() {
return myDatasource;
}
/**
* Sets the myDatasource.
* @param myDatasource the myDatasource to set
*/
public static void setMyDatasource(DataSource myDatasource) {
DataSourceConnectionProvider.myDatasource = myDatasource;
}
}