org.hibernate.dialect
Class DialectFactory
java.lang.Object
org.hibernate.dialect.DialectFactory
public class DialectFactory
extends java.lang.Object
A factory for generating Dialect instances.
static Dialect | buildDialect(Properties props, String databaseName, int databaseMajorVersion) - Builds an appropriate Dialect instance.
|
static Dialect | buildDialect(String dialectName) - Returns a dialect instance given the name of the class to use.
|
static Dialect | determineDialect(String databaseName, int databaseMajorVersion) - Determine the appropriate Dialect to use given the database product name
and major version.
|
buildDialect
public static Dialect buildDialect(Properties props,
String databaseName,
int databaseMajorVersion)
throws HibernateException
Builds an appropriate Dialect instance.
If a dialect is explicitly named in the incoming properties, it is used. Otherwise, the database name and version
(obtained from connection metadata) are used to make the dertemination.
An exception is thrown if a dialect was not explicitly set and the database name is not known.
props
- The configuration properties.databaseName
- The name of the database product (obtained from metadata).databaseMajorVersion
- The major version of the database product (obtained from metadata).
buildDialect
public static Dialect buildDialect(String dialectName)
Returns a dialect instance given the name of the class to use.
dialectName
- The name of the dialect class.
determineDialect
public static Dialect determineDialect(String databaseName,
int databaseMajorVersion)
Determine the appropriate Dialect to use given the database product name
and major version.
databaseName
- The name of the database product (obtained from metadata).databaseMajorVersion
- The major version of the database product (obtained from metadata).
- An appropriate dialect instance.