本文整理汇总了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();
}
示例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 );
}
}
示例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 );
}
}
示例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 );
}
}
示例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 );
}
}
示例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 );
}
}
示例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);
}
示例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 );
}
}
示例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);
}
}
示例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);
}
示例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 );
}
}
示例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);
}
}