HHH-6946 - Add support for the AS400 (iSeries) system to

StandardDialectResolver
This commit is contained in:
nrodrigues 2012-01-07 10:53:20 +00:00 committed by Strong Liu
parent 22a6283e6d
commit e6df116a49
2 changed files with 7 additions and 0 deletions

View File

@ -27,6 +27,7 @@ import java.sql.DatabaseMetaData;
import java.sql.SQLException; import java.sql.SQLException;
import org.hibernate.dialect.CUBRIDDialect; import org.hibernate.dialect.CUBRIDDialect;
import org.hibernate.dialect.DB2400Dialect;
import org.hibernate.dialect.DB2Dialect; import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect; import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.DerbyTenFiveDialect; import org.hibernate.dialect.DerbyTenFiveDialect;
@ -150,6 +151,10 @@ public class StandardDialectResolver extends AbstractDialectResolver {
return new InformixDialect(); return new InformixDialect();
} }
if ( databaseName.equals("DB2 UDB for AS/400" ) ) {
return new DB2400Dialect();
}
if ( databaseName.startsWith( "DB2/" ) ) { if ( databaseName.startsWith( "DB2/" ) ) {
return new DB2Dialect(); return new DB2Dialect();
} }

View File

@ -35,6 +35,7 @@ import java.util.Properties;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.dialect.DB2400Dialect;
import org.hibernate.dialect.DB2Dialect; import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect; import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.DerbyTenFiveDialect; import org.hibernate.dialect.DerbyTenFiveDialect;
@ -148,6 +149,7 @@ public class DialectFactoryTest extends BaseUnitTestCase {
testDetermination( "DB2/SUN", DB2Dialect.class, resolver ); testDetermination( "DB2/SUN", DB2Dialect.class, resolver );
testDetermination( "DB2/LINUX390", DB2Dialect.class, resolver ); testDetermination( "DB2/LINUX390", DB2Dialect.class, resolver );
testDetermination( "DB2/AIX64", DB2Dialect.class, resolver ); testDetermination( "DB2/AIX64", DB2Dialect.class, resolver );
testDetermination( "DB2 UDB for AS/400", DB2400Dialect.class, resolver );
testDetermination( "Oracle", 8, Oracle8iDialect.class, resolver ); testDetermination( "Oracle", 8, Oracle8iDialect.class, resolver );
testDetermination( "Oracle", 9, Oracle9iDialect.class, resolver ); testDetermination( "Oracle", 9, Oracle9iDialect.class, resolver );
testDetermination( "Oracle", 10, Oracle10gDialect.class, resolver ); testDetermination( "Oracle", 10, Oracle10gDialect.class, resolver );