DialectFactory detection of Ingres metadata (Michael Leo)

Description

Although Hibernate ships with an Ingres dialect

org.hibernate.dialect.IngresDialect

it can't be found by the dialect factory

org.hibernate.dialect.DialectFactory

Although most tools can be forced to use the proper dialect, there is a circumstance
in Grails where there is no way to specify the correct Hibernate dialect for a custom
data source.

The patch is pretty straightforward. I've attached the output of "svn diff" from the
root of the latest branch.

Hope this makes sense,

Mike Leo

$ svn diff
Index: src/org/hibernate/dialect/DialectFactory.java
===================================================================
— src/org/hibernate/dialect/DialectFactory.java (revision 14289)
+++ src/org/hibernate/dialect/DialectFactory.java (working copy)
@@ -112,6 +112,9 @@
private static final Map MAPPERS = new HashMap();
static {
// TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
+ MAPPERS.put( "Ingres", new VersionInsensitiveMapper( "org.hibernate.dialect.IngresDialect" ) );
+ MAPPERS.put( "ingres", new VersionInsensitiveMapper( "org.hibernate.dialect.IngresDialect" ) );
+ MAPPERS.put( "INGRES", new VersionInsensitiveMapper( "org.hibernate.dialect.IngresDialect" ) );
MAPPERS.put( "HSQL Database Engine", new VersionInsensitiveMapper( "org.hibernate.dialect.HSQLDialect" ) );
MAPPERS.put( "DB2/NT", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
MAPPERS.put( "DB2/LINUX", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
$

Environment

Hibernate 3.x and frameworks based on the Spring Framework, like Grails

Activity

Show:
Emmanuel Bernard
February 6, 2008, 8:39 PM

Steve I put 3.2.6 just in case, feel free to delay

Steve Ebersole
February 7, 2008, 4:21 AM

its grails. of course

Steve Ebersole
February 7, 2008, 4:23 AM

looks good

Steve Ebersole
February 7, 2008, 4:24 AM

applied trunk/3.2

Assignee

Steve Ebersole

Reporter

Michael Leo

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure