liquibase.database.typeconversion.ext
Class H2TypeConverter

java.lang.Object
  extended by liquibase.database.typeconversion.core.AbstractTypeConverter
      extended by liquibase.database.typeconversion.core.H2TypeConverter
          extended by liquibase.database.typeconversion.ext.H2TypeConverter
All Implemented Interfaces:
liquibase.database.typeconversion.TypeConverter, liquibase.servicelocator.PrioritizedService

public class H2TypeConverter
extends liquibase.database.typeconversion.core.H2TypeConverter

Author:
Leo Przybylski

Field Summary
protected static List<Integer> oneParam
           
protected static List<Integer> twoParams
           
 
Fields inherited from interface liquibase.servicelocator.PrioritizedService
PRIORITY_DATABASE, PRIORITY_DEFAULT
 
Constructor Summary
H2TypeConverter()
           
 
Method Summary
protected  void addPrecisionToType(String precision, liquibase.database.structure.type.DataType returnTypeName)
           
 Object convertDatabaseValueToObject(Object value, int databaseDataType, int firstParameter, int secondParameter, liquibase.database.Database database)
           
 String convertToDatabaseTypeString(liquibase.database.structure.Column referenceColumn, liquibase.database.Database database)
           
protected  liquibase.database.structure.type.DataType getDataType(String columnTypeString, Boolean autoIncrement, String dataTypeName, String precision, String additionalInformation)
           
 int getPriority()
           
protected  String getSqlTypeName(int type)
          Convert the type value gotten from the metadata which is a value from Types to a String value that can be used in an SQL statement.
 
Methods inherited from class liquibase.database.typeconversion.core.H2TypeConverter
getBlobType, getClobType, getDateTimeType, getUUIDType, supports
 
Methods inherited from class liquibase.database.typeconversion.core.AbstractTypeConverter
convertToCorrectObjectType, getBigIntType, getBooleanType, getCharType, getCurrencyType, getDataType, getDataType, getDataType, getDateType, getDoubleType, getFloatType, getIntType, getLongBlobType, getNumberType, getNVarcharType, getSmallIntType, getTextType, getTimeType, getTinyIntType, getVarcharType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oneParam

protected static final List<Integer> oneParam

twoParams

protected static final List<Integer> twoParams
Constructor Detail

H2TypeConverter

public H2TypeConverter()
Method Detail

getPriority

public int getPriority()
Specified by:
getPriority in interface liquibase.database.typeconversion.TypeConverter
Specified by:
getPriority in interface liquibase.servicelocator.PrioritizedService
Overrides:
getPriority in class liquibase.database.typeconversion.core.H2TypeConverter

convertDatabaseValueToObject

public Object convertDatabaseValueToObject(Object value,
                                           int databaseDataType,
                                           int firstParameter,
                                           int secondParameter,
                                           liquibase.database.Database database)
                                    throws ParseException
Specified by:
convertDatabaseValueToObject in interface liquibase.database.typeconversion.TypeConverter
Overrides:
convertDatabaseValueToObject in class liquibase.database.typeconversion.core.H2TypeConverter
Throws:
ParseException

convertToDatabaseTypeString

public String convertToDatabaseTypeString(liquibase.database.structure.Column referenceColumn,
                                          liquibase.database.Database database)
Specified by:
convertToDatabaseTypeString in interface liquibase.database.typeconversion.TypeConverter
Overrides:
convertToDatabaseTypeString in class liquibase.database.typeconversion.core.AbstractTypeConverter

getSqlTypeName

protected String getSqlTypeName(int type)
                         throws Exception
Convert the type value gotten from the metadata which is a value from Types to a String value that can be used in an SQL statement. Example output:

Parameters:
type - int value found in
Returns:
String value including package of the type name.
Throws:
Exception

getDataType

protected liquibase.database.structure.type.DataType getDataType(String columnTypeString,
                                                                 Boolean autoIncrement,
                                                                 String dataTypeName,
                                                                 String precision,
                                                                 String additionalInformation)
Overrides:
getDataType in class liquibase.database.typeconversion.core.AbstractTypeConverter

addPrecisionToType

protected void addPrecisionToType(String precision,
                                  liquibase.database.structure.type.DataType returnTypeName)
                           throws NumberFormatException
Overrides:
addPrecisionToType in class liquibase.database.typeconversion.core.AbstractTypeConverter
Throws:
NumberFormatException


Copyright © 2011 Leo Przybylski. All Rights Reserved.