org.hibernate.dialect.resolver
Class AbstractDialectResolver

java.lang.Object
  extended by org.hibernate.dialect.resolver.AbstractDialectResolver
All Implemented Interfaces:
DialectResolver
Direct Known Subclasses:
BasicDialectResolver, StandardDialectResolver

public abstract class AbstractDialectResolver
extends Object
implements DialectResolver

A templated resolver impl which delegates to the resolveDialectInternal(java.sql.DatabaseMetaData) method and handles any thrown SQLExceptions.

Author:
Steve Ebersole

Constructor Summary
AbstractDialectResolver()
           
 
Method Summary
 Dialect resolveDialect(DatabaseMetaData metaData)
          Determine the Dialect to use based on the given JDBC DatabaseMetaData.
protected abstract  Dialect resolveDialectInternal(DatabaseMetaData metaData)
          Perform the actual resolution without caring about handling SQLExceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDialectResolver

public AbstractDialectResolver()
Method Detail

resolveDialect

public final Dialect resolveDialect(DatabaseMetaData metaData)
Determine the Dialect to use based on the given JDBC DatabaseMetaData. Implementations are expected to return the Dialect instance to use, or null if the DatabaseMetaData does not match the criteria handled by this impl.

Here we template the resolution, delegating to resolveDialectInternal(java.sql.DatabaseMetaData) and handling SQLExceptions properly.

Specified by:
resolveDialect in interface DialectResolver
Parameters:
metaData - The JDBC metadata.
Returns:
The dialect to use, or null.

resolveDialectInternal

protected abstract Dialect resolveDialectInternal(DatabaseMetaData metaData)
                                           throws SQLException
Perform the actual resolution without caring about handling SQLExceptions.

Parameters:
metaData - The database metadata
Returns:
The resolved dialect, or null if we could not resolve.
Throws:
SQLException - Indicates problems accessing the metadata.


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