org.qi4j.index.sql.support.skeletons
Class AbstractSQLStartup

java.lang.Object
  extended by org.qi4j.index.sql.support.skeletons.AbstractSQLStartup
All Implemented Interfaces:
Activatable, SQLAppStartup
Direct Known Subclasses:
PostgreSQLAppStartup

public abstract class AbstractSQLStartup
extends Object
implements SQLAppStartup, Activatable


Field Summary
static String DEFAULT_SCHEMA_NAME
           
 
Constructor Summary
AbstractSQLStartup()
           
 
Method Summary
 void activate()
          This is invoked on the service when the instance is being activated
protected  void checkSchemaName(String schemaName)
           
protected  boolean dropTablesIfExist(DatabaseMetaData metaData, String schemaName, String tableName, Statement stmt)
           
protected abstract  org.sql.generation.api.grammar.common.datatypes.SQLDataType getCollectionPathDataType()
           
protected  Long getNextPK(Statement stmt, String schemaName, String columnName, String tableName, Long defaultPK)
           
 void initConnection()
          This method is called when connection may be safely initialized - for example, possibly (re-)building database structure.
protected abstract  void modifyPrimitiveTypes(Map<Class<?>,org.sql.generation.api.grammar.common.datatypes.SQLDataType> primitiveTypes, Map<Class<?>,Integer> jdbcTypes)
           
 void passivate()
          This is invoked on the service when the instance is being passivated
protected abstract  void setVendor(org.sql.generation.api.vendor.SQLVendor vendor)
           
protected abstract  void testRequiredCapabilities()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SCHEMA_NAME

public static final String DEFAULT_SCHEMA_NAME
See Also:
Constant Field Values
Constructor Detail

AbstractSQLStartup

public AbstractSQLStartup()
Method Detail

activate

public void activate()
              throws Exception
Description copied from interface: Activatable
This is invoked on the service when the instance is being activated

Specified by:
activate in interface Activatable
Throws:
Exception - if service could not be activated

passivate

public void passivate()
               throws Exception
Description copied from interface: Activatable
This is invoked on the service when the instance is being passivated

Specified by:
passivate in interface Activatable
Throws:
Exception - if the service could not be passivated

initConnection

public void initConnection()
                    throws SQLException
Description copied from interface: SQLAppStartup
This method is called when connection may be safely initialized - for example, possibly (re-)building database structure.

Specified by:
initConnection in interface SQLAppStartup
Throws:
SQLException - If SQL.

checkSchemaName

protected void checkSchemaName(String schemaName)

getNextPK

protected Long getNextPK(Statement stmt,
                         String schemaName,
                         String columnName,
                         String tableName,
                         Long defaultPK)
                  throws SQLException
Throws:
SQLException

testRequiredCapabilities

protected abstract void testRequiredCapabilities()
                                          throws SQLException
Throws:
SQLException

dropTablesIfExist

protected boolean dropTablesIfExist(DatabaseMetaData metaData,
                                    String schemaName,
                                    String tableName,
                                    Statement stmt)
                             throws SQLException
Throws:
SQLException

modifyPrimitiveTypes

protected abstract void modifyPrimitiveTypes(Map<Class<?>,org.sql.generation.api.grammar.common.datatypes.SQLDataType> primitiveTypes,
                                             Map<Class<?>,Integer> jdbcTypes)

getCollectionPathDataType

protected abstract org.sql.generation.api.grammar.common.datatypes.SQLDataType getCollectionPathDataType()

setVendor

protected abstract void setVendor(org.sql.generation.api.vendor.SQLVendor vendor)