org.kuali.common.impex.schema.service.impl.liquibase
Class LiquibaseSchemaProvider

java.lang.Object
  extended by org.kuali.common.impex.schema.service.impl.liquibase.LiquibaseSchemaProvider

public class LiquibaseSchemaProvider
extends Object


Field Summary
protected static String METADATA_FK_COLUMN_NAME
           
protected static String METADATA_FK_NAME
          Constants for result set keys from DatabaseMetaData.getImportedKeys
protected static String METADATA_INDEX_COLUMN_NAME
           
protected static String METADATA_INDEX_NAME
           
protected static String METADATA_PK_COLUMN_NAME
           
protected static String[] RESERVED_DEFAULT_KEYWORDS
           
protected static String SINGLE_QUOTE
           
protected static String SYSDATE_KEYWORD_DEFAULT
           
protected static String SYSGUID_KEYWORD_DEFAULT
           
protected static String USERSESSION_KEYWORD_DEFAULT
           
 
Constructor Summary
LiquibaseSchemaProvider(DatabaseSnapshot snapshot, SequenceFinder sequenceFinder, DataSource dataSource)
           
 
Method Summary
protected  Column buildColumn(liquibase.structure.core.Column sourceColumn, boolean primaryKey, Table modelTable)
           
protected  List<ForeignKey> buildForeignKeys(DatabaseSnapshot snapshot)
           
 Schema buildSchema()
           
protected  List<Sequence> buildSequences(DatabaseSnapshot snapshot)
           
protected  List<Table> buildTables(DatabaseSnapshot snapshot)
           
protected  List<View> buildViews(DatabaseSnapshot snapshot)
           
protected  Collection<Index> getIndices(liquibase.structure.core.Table sourceTable, DatabaseSnapshot snapshot)
           
 org.kuali.common.util.StringFilter getNameFilter()
           
 String getSchemaName()
           
protected  boolean notReservedDefaultValue(String defaultValue)
          Check that the given column default value is not a reseved keyword
protected  void setColumnNames(ForeignKey fk, liquibase.structure.core.ForeignKey liquibaseFk, DatabaseSnapshot snapshot)
           
 void setNameFilter(org.kuali.common.util.StringFilter nameFilter)
           
 void setSchemaName(String schemaName)
           
 ForeignKeyConstraintType translateForeignKeyConstraint(liquibase.structure.core.ForeignKeyConstraintType rule)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METADATA_FK_NAME

protected static final String METADATA_FK_NAME
Constants for result set keys from DatabaseMetaData.getImportedKeys

See Also:
Constant Field Values

METADATA_FK_COLUMN_NAME

protected static final String METADATA_FK_COLUMN_NAME
See Also:
Constant Field Values

METADATA_PK_COLUMN_NAME

protected static final String METADATA_PK_COLUMN_NAME
See Also:
Constant Field Values

METADATA_INDEX_NAME

protected static final String METADATA_INDEX_NAME
See Also:
Constant Field Values

METADATA_INDEX_COLUMN_NAME

protected static final String METADATA_INDEX_COLUMN_NAME
See Also:
Constant Field Values

SINGLE_QUOTE

protected static final String SINGLE_QUOTE
See Also:
Constant Field Values

SYSGUID_KEYWORD_DEFAULT

protected static final String SYSGUID_KEYWORD_DEFAULT
See Also:
Constant Field Values

SYSDATE_KEYWORD_DEFAULT

protected static final String SYSDATE_KEYWORD_DEFAULT
See Also:
Constant Field Values

USERSESSION_KEYWORD_DEFAULT

protected static final String USERSESSION_KEYWORD_DEFAULT
See Also:
Constant Field Values

RESERVED_DEFAULT_KEYWORDS

protected static final String[] RESERVED_DEFAULT_KEYWORDS
Constructor Detail

LiquibaseSchemaProvider

public LiquibaseSchemaProvider(DatabaseSnapshot snapshot,
                               SequenceFinder sequenceFinder,
                               DataSource dataSource)
                        throws SQLException
Throws:
SQLException
Method Detail

buildSchema

public Schema buildSchema()
                   throws SQLException
Throws:
SQLException

buildTables

protected List<Table> buildTables(DatabaseSnapshot snapshot)

getIndices

protected Collection<Index> getIndices(liquibase.structure.core.Table sourceTable,
                                       DatabaseSnapshot snapshot)

buildColumn

protected Column buildColumn(liquibase.structure.core.Column sourceColumn,
                             boolean primaryKey,
                             Table modelTable)

notReservedDefaultValue

protected boolean notReservedDefaultValue(String defaultValue)
Check that the given column default value is not a reseved keyword

Parameters:
defaultValue - the potential column default value
Returns:
true if the given value does not contain a reserved keyword, false otherwise

buildViews

protected List<View> buildViews(DatabaseSnapshot snapshot)

buildSequences

protected List<Sequence> buildSequences(DatabaseSnapshot snapshot)
                                 throws SQLException
Throws:
SQLException

buildForeignKeys

protected List<ForeignKey> buildForeignKeys(DatabaseSnapshot snapshot)
                                     throws SQLException
Throws:
SQLException

translateForeignKeyConstraint

public ForeignKeyConstraintType translateForeignKeyConstraint(liquibase.structure.core.ForeignKeyConstraintType rule)

setColumnNames

protected void setColumnNames(ForeignKey fk,
                              liquibase.structure.core.ForeignKey liquibaseFk,
                              DatabaseSnapshot snapshot)
                       throws SQLException
Throws:
SQLException

getNameFilter

public org.kuali.common.util.StringFilter getNameFilter()

setNameFilter

public void setNameFilter(org.kuali.common.util.StringFilter nameFilter)

getSchemaName

public String getSchemaName()

setSchemaName

public void setSchemaName(String schemaName)


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.