本文整理汇总了Java中org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo类的典型用法代码示例。如果您正苦于以下问题:Java DialectResolutionInfo类的具体用法?Java DialectResolutionInfo怎么用?Java DialectResolutionInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DialectResolutionInfo类属于org.hibernate.engine.jdbc.dialect.spi包,在下文中一共展示了DialectResolutionInfo类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: determineDialect
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; //导入依赖的package包/类
/**
* Determine the appropriate Dialect to use given the connection.
*
* @param resolutionInfoSource Access to DialectResolutionInfo used to resolve the Dialect.
*
* @return The appropriate dialect instance.
*
* @throws HibernateException No connection given or no resolver could make
* the determination from the given connection.
*/
private Dialect determineDialect(DialectResolutionInfoSource resolutionInfoSource) {
if ( resolutionInfoSource == null ) {
throw new HibernateException( "Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set" );
}
final DialectResolutionInfo info = resolutionInfoSource.getDialectResolutionInfo();
final Dialect dialect = dialectResolver.resolveDialect( info );
if ( dialect == null ) {
throw new HibernateException(
"Unable to determine Dialect to use [name=" + info.getDatabaseName() +
", majorVersion=" + info.getDatabaseMajorVersion() +
"]; user must register resolver or explicitly set 'hibernate.dialect'"
);
}
return dialect;
}
示例2: matches
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; //导入依赖的package包/类
@Override
public boolean matches(Object object) {
DialectResolver actual = (DialectResolver) object;
DialectResolutionInfo info = mock(DialectResolutionInfo.class);
when(info.getDatabaseName()).thenReturn(databaseName);
if ("SQLite".equals(databaseName)) {
return actual.resolveDialect(info) instanceof SQLiteDialect;
} else {
return actual.resolveDialect(info) == null;
}
}
示例3: resolveDialect
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; //导入依赖的package包/类
@Override
public Dialect resolveDialect(DialectResolutionInfo info) {
if ("DB2".equals(info.getDatabaseName())) {
LOG.debug("DB2 detected returning DB2390Dialect");
return new DB2390Dialect();
}
return null;
}
示例4: resolveDialect
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; //导入依赖的package包/类
@Override
public Dialect resolveDialect(DialectResolutionInfo dialectResolutionInfo) {
if ("MySQL".equals(dialectResolutionInfo.getDatabaseName())) {
return dialectResolutionInfo.getDatabaseMajorVersion() >= 5 ? new Mysql5BitBooleanDialect() : new MySQLDialect();
}
return null;
}
示例5: resolveDialect
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; //导入依赖的package包/类
@Override
public Dialect resolveDialect(DialectResolutionInfo info) {
if (info.getDatabaseName().equals("SQLite"))
return dialect;
return null;
}
示例6: resolveDialect
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; //导入依赖的package包/类
@Nullable
@Override
public Dialect resolveDialect(DialectResolutionInfo info) {
return (info.getDatabaseName().equals(HsqlDatabaseProperties.PRODUCT_NAME) ? SdcctHsqlDialect.INSTANCE : null);
}
示例7: resolveDialect
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; //导入依赖的package包/类
@Override
public Dialect resolveDialect(final DialectResolutionInfo info) {
return new AllowMissingIdentitySupportDialect(super.resolveDialect(info));
}