Java 类org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo 实例源码

项目:lams    文件:DialectFactoryImpl.java   
/**
 * 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;
}
项目:sqlite-dialect    文件:SQLiteMetadataBuilderInitializerTest.java   
@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;
    }
}
项目:mid-tier    文件:DB2DialectResolver.java   
@Override
public Dialect resolveDialect(DialectResolutionInfo info) {
    if ("DB2".equals(info.getDatabaseName())) {
        LOG.debug("DB2 detected returning DB2390Dialect");
        return new DB2390Dialect();
    }
    return null;
}
项目:aerogear-unifiedpush-server    文件:MysqlDialectResolver.java   
@Override
public Dialect resolveDialect(DialectResolutionInfo dialectResolutionInfo) {
    if ("MySQL".equals(dialectResolutionInfo.getDatabaseName())) {
        return dialectResolutionInfo.getDatabaseMajorVersion() >= 5 ? new Mysql5BitBooleanDialect() : new MySQLDialect();
    }
    return null;
}
项目:sqlite-dialect    文件:SQLiteMetadataBuilderInitializer.java   
@Override
public Dialect resolveDialect(DialectResolutionInfo info) {
    if (info.getDatabaseName().equals("SQLite"))
        return dialect;
    return null;
}
项目:sdcct    文件:SdcctHsqlDialect.java   
@Nullable
@Override
public Dialect resolveDialect(DialectResolutionInfo info) {
    return (info.getDatabaseName().equals(HsqlDatabaseProperties.PRODUCT_NAME) ? SdcctHsqlDialect.INSTANCE : null);
}
项目:org.fastnate    文件:AllowMissingIdentitySupportDialectResolver.java   
@Override
public Dialect resolveDialect(final DialectResolutionInfo info) {
    return new AllowMissingIdentitySupportDialect(super.resolveDialect(info));
}