Top Description Fields Constructors Methods
org.hibernate.dialect.resolver

public Class DialectFactory

extends Object
Class Inheritance
Imports
java.sql.Connection, .SQLException, .DatabaseMetaData, java.util.Properties, org.hibernate.HibernateException, org.hibernate.dialect.resolver.DialectResolver, .DialectResolverSet, .StandardDialectResolver, org.hibernate.dialect.Dialect, org.hibernate.cfg.Environment, org.hibernate.util.ReflectHelper, org.slf4j.Logger, .LoggerFactory

A factory for generating Dialect instances.
Authors
Steve Ebersole, Tomoto Shimizu Washio

Field Summary

Modifier and TypeField and Description
private static DialectResolverSet
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Dialect

Returns:

The appropriate dialect instance.
buildDialect
(Properties
The configuration properties.
properties
,
Connection
The configured connection.
connection
)

Builds an appropriate Dialect instance.

public static Dialect
public static Dialect

Returns:

The dialect instance.
constructDialect
(String
The name of the dialect class.
dialectName
)

Returns a dialect instance given the name of the class to use.

private static Dialect

Returns:

The appropriate dialect instance.
determineDialect
(Connection
The configured connection.
connection
)

Determine the appropriate Dialect to use given the connection.

pack-priv static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DIALECT_RESOLVERSback to summary
private static DialectResolverSet DIALECT_RESOLVERS
logback to summary
private static final Logger log

Constructor Detail

DialectFactoryback to summary
public DialectFactory()

Method Detail

buildDialectback to summary
public static Dialect buildDialect(Properties properties, Connection connection) throws HibernateException

Builds an appropriate Dialect instance.

If a dialect is explicitly named in the incoming properties, it is used. Otherwise, it is determined by dialect resolvers based on the passed connection.

An exception is thrown if a dialect was not explicitly set and no resolver could make the determination from the given connection.

Parameters
properties:Properties

The configuration properties.

connection:Connection

The configured connection.

Returns:Dialect

The appropriate dialect instance.

Exceptions
HibernateException:
No dialect specified and no resolver could make the determination.
buildDialectback to summary
public static Dialect buildDialect(Properties properties)
constructDialectback to summary
public static Dialect constructDialect(String dialectName)

Returns a dialect instance given the name of the class to use.

Parameters
dialectName:String

The name of the dialect class.

Returns:Dialect

The dialect instance.

determineDialectback to summary
private static Dialect determineDialect(Connection connection)

Determine the appropriate Dialect to use given the connection.

Parameters
connection:Connection

The configured connection.

Returns:Dialect

The appropriate dialect instance.

Exceptions
HibernateException:
No connection given or no resolver could make the determination from the given connection.
registerDialectResolverback to summary
pack-priv static void registerDialectResolver(String resolverName)