org.hibernate.cfg.reveng.dialect
Class AbstractMetaDataDialect

java.lang.Object
  extended by org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect
All Implemented Interfaces:
MetaDataDialect
Direct Known Subclasses:
JDBCMetaDataDialect, OracleMetaDataDialect

public abstract class AbstractMetaDataDialect
extends Object
implements MetaDataDialect

abstract base class for the metadatadialects to hold the basic setup classes.

Author:
max

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
AbstractMetaDataDialect()
           
 
Method Summary
protected  String caseForSearch(String value)
           
 void close()
          Close any resources this dialect might have used.
 void close(Iterator iterator)
          Close the iterator.
 void configure(ReverseEngineeringRuntimeInfo info)
          Configure the metadatadialect.
protected  Connection getConnection()
           
protected  String getDatabaseStructure(String catalog, String schema)
           
protected  DatabaseMetaData getMetaData()
           
 ReverseEngineeringRuntimeInfo getReverseEngineeringRuntimeInfo()
           
protected  org.hibernate.exception.SQLExceptionConverter getSQLExceptionConverter()
           
 Iterator getSuggestedPrimaryKeyStrategyName(String catalog, String schema, String table)
          Use database (possible native) metadata to suggest identifier strategy.
 boolean needQuote(String name)
          Does this name need quoting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.cfg.reveng.dialect.MetaDataDialect
getColumns, getExportedKeys, getIndexInfo, getPrimaryKeys, getTables
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

AbstractMetaDataDialect

public AbstractMetaDataDialect()
Method Detail

configure

public void configure(ReverseEngineeringRuntimeInfo info)
Description copied from interface: MetaDataDialect
Configure the metadatadialect.

Specified by:
configure in interface MetaDataDialect
Parameters:
info - a ReverseEngineeringRuntimeInfo to extract Connection and SQLExceptionConverter and other runtime info

close

public void close()
Description copied from interface: MetaDataDialect
Close any resources this dialect might have used.

Specified by:
close in interface MetaDataDialect

getMetaData

protected DatabaseMetaData getMetaData()
                                throws JDBCBinderException
Throws:
JDBCBinderException

getDatabaseStructure

protected String getDatabaseStructure(String catalog,
                                      String schema)

getConnection

protected Connection getConnection()
                            throws SQLException
Throws:
SQLException

getReverseEngineeringRuntimeInfo

public ReverseEngineeringRuntimeInfo getReverseEngineeringRuntimeInfo()

close

public void close(Iterator iterator)
Description copied from interface: MetaDataDialect
Close the iterator.

Specified by:
close in interface MetaDataDialect
Parameters:
iterator - an iterator returned from one of methods on this dialect

getSQLExceptionConverter

protected org.hibernate.exception.SQLExceptionConverter getSQLExceptionConverter()

needQuote

public boolean needQuote(String name)
Description copied from interface: MetaDataDialect
Does this name need quoting

Specified by:
needQuote in interface MetaDataDialect
Returns:

caseForSearch

protected String caseForSearch(String value)
                        throws SQLException
Throws:
SQLException

getSuggestedPrimaryKeyStrategyName

public Iterator getSuggestedPrimaryKeyStrategyName(String catalog,
                                                   String schema,
                                                   String table)
Description copied from interface: MetaDataDialect
Use database (possible native) metadata to suggest identifier strategy.

Specified by:
getSuggestedPrimaryKeyStrategyName in interface MetaDataDialect
Returns:
iterator with map elements that has "TABLE_NAME", "TABLE_SCHEMA", "TABLE_CAT", "HIBERNATE_STRATEGY" (null if no possible to determine strategy, otherwise return hibernate identifier strategy name/classname)