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

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

public abstract class AbstractSQLStartup
extends java.lang.Object
implements SQLAppStartup


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.qi4j.index.sql.support.api.SQLAppStartup
SQLAppStartup.Activator
 
Field Summary
static java.lang.String DEFAULT_SCHEMA_NAME
           
 
Constructor Summary
AbstractSQLStartup(ServiceDescriptor descriptor)
           
 
Method Summary
protected  void checkSchemaName(java.lang.String schemaName)
           
protected static java.lang.String compositeDescriptorToString(LayerDescriptor layer, ModuleDescriptor module, CompositeDescriptor descriptor)
           
protected  boolean dropTablesIfExist(java.lang.String schemaName, java.lang.String tableName, java.sql.Statement stmt)
           
protected abstract  org.sql.generation.api.grammar.common.datatypes.SQLDataType getCollectionPathDataType()
           
protected  java.lang.Long getNextPK(java.sql.Statement stmt, java.lang.String schemaName, java.lang.String columnName, java.lang.String tableName, java.lang.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(java.util.Map<java.lang.Class<?>,org.sql.generation.api.grammar.common.datatypes.SQLDataType> primitiveTypes, java.util.Map<java.lang.Class<?>,java.lang.Integer> jdbcTypes)
           
protected static
<TCompositeDescriptor extends CompositeDescriptor>
TCompositeDescriptor
stringToCompositeDescriptor(java.lang.Class<TCompositeDescriptor> descriptorClass, ApplicationDescriptor appDesc, java.lang.String str)
           
protected abstract  void testRequiredCapabilities(java.sql.Connection connection)
           
 
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 java.lang.String DEFAULT_SCHEMA_NAME
See Also:
Constant Field Values
Constructor Detail

AbstractSQLStartup

public AbstractSQLStartup(@Uses
                          ServiceDescriptor descriptor)
Method Detail

initConnection

public void initConnection()
                    throws java.sql.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:
java.sql.SQLException - If SQL error.

checkSchemaName

protected void checkSchemaName(java.lang.String schemaName)

getNextPK

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

testRequiredCapabilities

protected abstract void testRequiredCapabilities(java.sql.Connection connection)
                                          throws java.sql.SQLException
Throws:
java.sql.SQLException

dropTablesIfExist

protected boolean dropTablesIfExist(java.lang.String schemaName,
                                    java.lang.String tableName,
                                    java.sql.Statement stmt)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

compositeDescriptorToString

protected static java.lang.String compositeDescriptorToString(LayerDescriptor layer,
                                                              ModuleDescriptor module,
                                                              CompositeDescriptor descriptor)

stringToCompositeDescriptor

protected static <TCompositeDescriptor extends CompositeDescriptor> TCompositeDescriptor stringToCompositeDescriptor(java.lang.Class<TCompositeDescriptor> descriptorClass,
                                                                                                                     ApplicationDescriptor appDesc,
                                                                                                                     java.lang.String str)

modifyPrimitiveTypes

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

getCollectionPathDataType

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