org.dbmaintain.database
Class IdentifierProcessorFactory

java.lang.Object
  extended by org.dbmaintain.database.IdentifierProcessorFactory

public class IdentifierProcessorFactory
extends Object

Author:
Tim Ducheyne, Filip Neven

Field Summary
protected  Properties configuration
           
 
Constructor Summary
IdentifierProcessorFactory(Properties configuration)
           
 
Method Summary
 IdentifierProcessor createIdentifierProcessor(String databaseDialect, String defaultSchemaName, DataSource dataSource)
           
protected  String determineIdentifierQuoteString(String customIdentifierQuoteString, DataSource dataSource)
          Determines the string used to quote identifiers to make them case-sensitive.
protected  StoredIdentifierCase determineStoredIdentifierCase(StoredIdentifierCase customStoredIdentifierCase, DataSource dataSource)
          Determines the case the database uses to store non-quoted identifiers.
protected  String getCustomIdentifierQuoteString(String databaseDialect, Properties configuration)
           
protected  StoredIdentifierCase getCustomStoredIdentifierCase(String databaseDialect, Properties configuration)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configuration

protected Properties configuration
Constructor Detail

IdentifierProcessorFactory

public IdentifierProcessorFactory(Properties configuration)
Method Detail

createIdentifierProcessor

public IdentifierProcessor createIdentifierProcessor(String databaseDialect,
                                                     String defaultSchemaName,
                                                     DataSource dataSource)

determineStoredIdentifierCase

protected StoredIdentifierCase determineStoredIdentifierCase(StoredIdentifierCase customStoredIdentifierCase,
                                                             DataSource dataSource)
Determines the case the database uses to store non-quoted identifiers. This will use the connections database metadata to determine the correct case.

Parameters:
customStoredIdentifierCase - The stored case: possible values 'lower_case', 'upper_case', 'mixed_case' and 'auto'
dataSource - The datas ource, not null
Returns:
The stored case, not null

determineIdentifierQuoteString

protected String determineIdentifierQuoteString(String customIdentifierQuoteString,
                                                DataSource dataSource)
Determines the string used to quote identifiers to make them case-sensitive. This will use the connections database metadata to determine the quote string.

Parameters:
customIdentifierQuoteString - If not null, it specifies a custom identifier quote string that replaces the one specified by the JDBC DatabaseMetaData object
dataSource - The datas ource, not null
Returns:
The quote string, null if quoting is not supported

getCustomStoredIdentifierCase

protected StoredIdentifierCase getCustomStoredIdentifierCase(String databaseDialect,
                                                             Properties configuration)

getCustomIdentifierQuoteString

protected String getCustomIdentifierQuoteString(String databaseDialect,
                                                Properties configuration)


Copyright © 2011. All Rights Reserved.