org.hibernate.dialect.resolver
Class DialectFactory

java.lang.Object
  extended by org.hibernate.dialect.resolver.DialectFactory

public class DialectFactory
extends Object

A factory for generating Dialect instances.

Author:
Steve Ebersole, Tomoto Shimizu Washio

Constructor Summary
DialectFactory()
           
 
Method Summary
static Dialect buildDialect(Properties properties)
           
static Dialect buildDialect(Properties properties, Connection connection)
          Builds an appropriate Dialect instance.
static Dialect constructDialect(String dialectName)
          Returns a dialect instance given the name of the class to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialectFactory

public DialectFactory()
Method Detail

buildDialect

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 - The configuration properties.
connection - The configured connection.
Returns:
The appropriate dialect instance.
Throws:
HibernateException - No dialect specified and no resolver could make the determination.

buildDialect

public static Dialect buildDialect(Properties properties)

constructDialect

public static Dialect constructDialect(String dialectName)
Returns a dialect instance given the name of the class to use.

Parameters:
dialectName - The name of the dialect class.
Returns:
The dialect instance.


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.