Thanks for the quick response. This still does not work.
Keep in mind, I am running this through the liquibase maven plugin.
I added a static initializer to my type converter, and it never gets fired.
Here is the exception:
Failed to execute goal org.liquibase:liquibase-maven:2.0-rc2-SNAPSHOT:update (default) on project pas.database: Execution default of goal org.liquibase:liquibase-maven:2.0-rc2-SNAPSHOT:update failed: Could not determine NVARCHAR for liquibase.database.typeconversion.core.OracleTypeConverter -> [Help 1]
Here is my updated class…
public class CustomOracleTypeConverter extends OracleTypeConverter {
static {
System.err.println( “\r\n\r\n\r\n!!!\r\n\r\n\r\n\r\n”);
}
@Override
public int getPriority() {
return PRIORITY_DATABASE + 1;
}
@Override
protected DataType getDataType(String columnTypeString, Boolean autoIncrement, String dataTypeName, String precision) {
System.err.println( “\r\n\r\n\r\n!!!\r\n\r\n\r\n\r\n”);
DataType returnType = null;
// Convert NVARCHAR to VARCHAR
if( columnTypeString.startsWith( “java.sql.Types” ) && precision != null ) {
if( dataTypeName.equalsIgnoreCase( “NVARCHAR” ) ) {
returnType = new VarcharType( “VARCHAR2” );
// Do a 3x precision
Integer precisionValue = Integer.parseInt( precision ) * 3;
precision = precisionValue.toString();
addPrecisionToType( precision, returnType );
return returnType;
}
}
return super.getDataType( columnTypeString, autoIncrement, dataTypeName, precision );
}
@Override
public boolean supports( Database database ) {
System.err.println( “\r\n\r\n\r\n!!!\r\n\r\n\r\n\r\n”);
return super.supports( database );
}
}
HERE is the POM snippet that I am using:
org.liquibase
liquibase-maven
2.0-rc2-SNAPSHOT
package
sqlservertest.xml
oracle.jdbc.OracleDriver
${local.database.url}
lb_test
lb_test
false
true
true
debug
true
update
com.oracle
ojdbc14
10.2.0.4