Code example for HibernateException

0
	@Override 
	public void configure(Properties props) throws HibernateException {
		this.dataSource = LocalSessionFactoryBean.getConfigTimeDataSource();
		// absolutely needs thread-bound DataSource to initialize 
		if (this.dataSource == null) {
			throw new HibernateException("No local DataSource found for configuration - " +
				"'dataSource' property must be set on LocalSessionFactoryBean"); 
		} 
		this.dataSourceToUse = getDataSourceToUse(this.dataSource);
	} 
 
	/** 
	 * Return the DataSource to use for retrieving Connections. 
	 * <p>This implementation returns the passed-in DataSource as-is. 
	 * @param originalDataSource the DataSource as configured by the user 
	 * on LocalSessionFactoryBean 
	 * @return the DataSource to actually retrieve Connections from 
	 * (potentially wrapped) 
	 * @see LocalSessionFactoryBean#setDataSource 
	 */ 
Experience pair programming with AI  Get Codota for Java