From c7707b23f001aa5f3224887897f716f8e5d820eb Mon Sep 17 00:00:00 2001 From: Brett Meyer Date: Sun, 7 Jul 2013 21:46:01 -0400 Subject: [PATCH] HHH-8349 added PostgresPlus to DialectFactory --- .../internal/StandardDatabaseInfoDialectResolver.java | 5 +++++ .../org/hibernate/dialect/resolver/DialectFactoryTest.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/StandardDatabaseInfoDialectResolver.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/StandardDatabaseInfoDialectResolver.java index 996fa571fd..11e325b66b 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/StandardDatabaseInfoDialectResolver.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/StandardDatabaseInfoDialectResolver.java @@ -44,6 +44,7 @@ import org.hibernate.dialect.Oracle9iDialect; import org.hibernate.dialect.PostgreSQL81Dialect; import org.hibernate.dialect.PostgreSQL82Dialect; import org.hibernate.dialect.PostgreSQL9Dialect; +import org.hibernate.dialect.PostgresPlusDialect; import org.hibernate.dialect.SQLServer2005Dialect; import org.hibernate.dialect.SQLServer2008Dialect; import org.hibernate.dialect.SQLServerDialect; @@ -103,6 +104,10 @@ public class StandardDatabaseInfoDialectResolver implements DatabaseInfoDialectR return new PostgreSQL81Dialect(); } + + if ( "EnterpriseDB".equals( databaseName ) ) { + return new PostgresPlusDialect(); + } if ( "Apache Derby".equals( databaseName ) ) { final int majorVersion = databaseInfo.getDatabaseMajorVersion(); diff --git a/hibernate-core/src/test/java/org/hibernate/dialect/resolver/DialectFactoryTest.java b/hibernate-core/src/test/java/org/hibernate/dialect/resolver/DialectFactoryTest.java index 4cab9a4017..fea66968c6 100644 --- a/hibernate-core/src/test/java/org/hibernate/dialect/resolver/DialectFactoryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/dialect/resolver/DialectFactoryTest.java @@ -56,6 +56,7 @@ import org.hibernate.dialect.Oracle9iDialect; import org.hibernate.dialect.PostgreSQL81Dialect; import org.hibernate.dialect.PostgreSQL82Dialect; import org.hibernate.dialect.PostgreSQL9Dialect; +import org.hibernate.dialect.PostgresPlusDialect; import org.hibernate.dialect.SQLServerDialect; import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.dialect.SybaseAnywhereDialect; @@ -148,6 +149,7 @@ public class DialectFactoryTest extends BaseUnitTestCase { testDetermination( "PostgreSQL", PostgreSQL81Dialect.class, resolver ); testDetermination( "PostgreSQL", 8, 2, PostgreSQL82Dialect.class, resolver ); testDetermination( "PostgreSQL", 9, 0, PostgreSQL9Dialect.class, resolver ); + testDetermination( "EnterpriseDB", 9, 2, PostgresPlusDialect.class, resolver ); testDetermination( "Apache Derby", 10, 4, DerbyDialect.class, resolver ); testDetermination( "Apache Derby", 10, 5, DerbyTenFiveDialect.class, resolver ); testDetermination( "Apache Derby", 10, 6, DerbyTenSixDialect.class, resolver );