当前位置: 首页>>代码示例>>Java>>正文


Java UnknownUnwrapTypeException类代码示例

本文整理汇总了Java中org.hibernate.service.UnknownUnwrapTypeException的典型用法代码示例。如果您正苦于以下问题:Java UnknownUnwrapTypeException类的具体用法?Java UnknownUnwrapTypeException怎么用?Java UnknownUnwrapTypeException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UnknownUnwrapTypeException类属于org.hibernate.service包,在下文中一共展示了UnknownUnwrapTypeException类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testConnectionProvider

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Test
public void testConnectionProvider() throws Exception
{
   HikariConnectionProvider provider = new HikariConnectionProvider();

   Properties props = new Properties();
   props.load(getClass().getResourceAsStream("/hibernate.properties"));

   provider.configure(props);
   Connection connection = provider.getConnection();
   provider.closeConnection(connection);

   Assert.assertNotNull(provider.unwrap(HikariConnectionProvider.class));
   Assert.assertFalse(provider.supportsAggressiveRelease());

   try {
      provider.unwrap(TestHibernate.class);
      Assert.fail("Expected exception");
   }
   catch (UnknownUnwrapTypeException e) {
   }

   provider.stop();
}
 
开发者ID:openbouquet,项目名称:HikariCP,代码行数:25,代码来源:TestHibernate.java

示例2: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
  public <T> T unwrap(Class<T> unwrapType) {
      if (ConnectionProvider.class.equals(unwrapType) ||
              CustomJDBCConnectionProvider.class.isAssignableFrom(unwrapType)) {
          return (T) this;
      } else {
          throw new UnknownUnwrapTypeException( unwrapType );
      }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:CustomJDBCConnectionProvider.java

示例3: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public <T> T unwrap(Class<T> unwrapType) {
	if ( isUnwrappableAs( unwrapType ) ) {
		return (T) this;
	}
	else {
		throw new UnknownUnwrapTypeException( unwrapType );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:AbstractMultiTenantConnectionProvider.java

示例4: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public <T> T unwrap(Class<T> unwrapType) {
	if ( ConnectionProvider.class.equals( unwrapType ) ||
			DriverManagerConnectionProviderImpl.class.isAssignableFrom( unwrapType ) ) {
		return (T) this;
	}
	else {
		throw new UnknownUnwrapTypeException( unwrapType );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:DriverManagerConnectionProviderImpl.java

示例5: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public <T> T unwrap(Class<T> unwrapType) {
	if ( ConnectionProvider.class.equals( unwrapType ) ||
			UserSuppliedConnectionProviderImpl.class.isAssignableFrom( unwrapType ) ) {
		return (T) this;
	}
	else {
		throw new UnknownUnwrapTypeException( unwrapType );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:UserSuppliedConnectionProviderImpl.java

示例6: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public <T> T unwrap(Class<T> unwrapType) {
	if ( ConnectionProvider.class.equals( unwrapType ) ||
			DatasourceConnectionProviderImpl.class.isAssignableFrom( unwrapType ) ) {
		return (T) this;
	}
	else if ( DataSource.class.isAssignableFrom( unwrapType ) ) {
		return (T) getDataSource();
	}
	else {
		throw new UnknownUnwrapTypeException( unwrapType );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:DatasourceConnectionProviderImpl.java

示例7: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> unwrapType) {
	if (ConnectionProvider.class.equals(unwrapType) || DBCPConnectionProvider.class.isAssignableFrom(unwrapType)) {
		return (T) this;
	}
	if (DataSource.class.isAssignableFrom(unwrapType)) {
		return (T) this.dataSource;
	}
	throw new UnknownUnwrapTypeException(unwrapType);
}
 
开发者ID:stickfigure,项目名称:postguice,代码行数:12,代码来源:DBCPConnectionProvider.java

示例8: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> unwrapType)
{
    if ( ConnectionProvider.class.equals( unwrapType ) ||
            HikariConnectionProvider.class.isAssignableFrom( unwrapType ) ) {
        return (T) this;
    }
    else if ( DataSource.class.isAssignableFrom( unwrapType ) ) {
        return (T) this.hds;
    }
    else {
        throw new UnknownUnwrapTypeException( unwrapType );
    }
}
 
开发者ID:openbouquet,项目名称:HikariCP,代码行数:16,代码来源:HikariConnectionProvider.java

示例9: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
@SuppressWarnings({ "unchecked" })
public <T> T unwrap(final Class<T> unwrapType) {
    if (ConnectionProvider.class.equals(unwrapType)
            || BeanLookupDatasourceConnectionProvider.class.isAssignableFrom(unwrapType)) {
        return (T) this;
    } else if (DataSource.class.isAssignableFrom(unwrapType)) {
        return (T) dataSource;
    } else {
        throw new UnknownUnwrapTypeException(unwrapType);
    }
}
 
开发者ID:subes,项目名称:invesdwin-context-persistence,代码行数:13,代码来源:BeanLookupDatasourceConnectionProvider.java

示例10: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T> T unwrap(Class<T> unwrapType) {

	if (BoneCPConnectionProvider.class.equals(unwrapType) || BoneCPConnectionProvider.class.isAssignableFrom(unwrapType)) {
		return (T) this;
	} else {
		throw new UnknownUnwrapTypeException(unwrapType);
	}
}
 
开发者ID:infinitiessoft,项目名称:keystone4j,代码行数:11,代码来源:BoneCPConnectionProvider.java

示例11: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public <T> T unwrap(Class<T> unwrapType) {
    if (isUnwrappableAs(unwrapType))
        return (T) this;
    else
        throw new UnknownUnwrapTypeException(unwrapType);
}
 
开发者ID:vibur,项目名称:vibur-dbcp-hibernate4.012,代码行数:9,代码来源:ViburDBCPConnectionProvider.java

示例12: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public <T> T unwrap(Class<T> unwrapType) {
    if ( ConnectionProvider.class.equals( unwrapType ) ||
            CloudSqlConnectionProvider.class.isAssignableFrom( unwrapType ) ) {
        return (T) this;
    }
    else {
        throw new UnknownUnwrapTypeException( unwrapType );
    }
}
 
开发者ID:bedatadriven,项目名称:appengine-hibernate,代码行数:12,代码来源:CloudSqlConnectionProvider.java

示例13: unwrap

import org.hibernate.service.UnknownUnwrapTypeException; //导入依赖的package包/类
@Override
@SuppressWarnings({ "unchecked" })
public <T> T unwrap(Class<T> unwrapType) {
	if (ConnectionProvider.class.equals(unwrapType)
			|| DatasourceConnectionProviderImpl.class.isAssignableFrom(unwrapType)) {
		return (T) this;
	} else if (DataSource.class.isAssignableFrom(unwrapType)) {
		return (T) this.dataSource;
	} else {
		throw new UnknownUnwrapTypeException(unwrapType);
	}
}
 
开发者ID:zdtjss,项目名称:nway-jdbc,代码行数:13,代码来源:JndiConnectionProvider.java


注:本文中的org.hibernate.service.UnknownUnwrapTypeException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。