Closed adriens closed 6 years ago
For SchemaCrawlerOptions
see ApiExample.java
For schemacrawler.schema.JavaSqlType
, use something like:
public static final boolean isSqlTypeLargeTextBased(ColumnDataType dataType)
{
return EnumSet.of(JavaSqlTypeGroup.binary, JavaSqlTypeGroup.large_object)
.contains(dataType.getJavaSqlType().getJavaSqlTypeGroup())
|| "text".equalsIgnoreCase(dataType.getDatabaseSpecificTypeName());
}
The reason that schemacrawler.schema.JavaSqlType
has lost its getJavaSqlType()
method is that Java 8 has made the java.sql.Types
type number vendor specific. Java 8 adds java.sql.SQLType
with a getVendorTypeNumber()
, and the JDBC implementation is just one of the possible implementations. The default implementation is java.sql.JDBCType
, which wraps the java.sql.Types
type number in getVendorTypeNumber()
. However, each database driver is free to provide it's own implementation.
SchemaCrawler's schemacrawler.schema.JavaSqlType
is now an enhanced version of Java's java.sql.JDBCType
.
WOW, I did not pay attention to this...this is not a little change for this part of the code. It means we depend on jdbc drivers implementation/database vendor...in a way, ...it sucks :smile:
We have to :thinking: about it on our side...
Context
We plan to upgrade the latest debian package, including additional lints? Still the 15.x has seen a lot of code refactoring causing compile failure. Any guidelines would be greatly apprciated.
Environment
Issue
We are trying to upgrade additional-lints (see https://github.com/mbarre/schemacrawler-additional-lints/issues/131) but some interfaces and methods have changed a lot, causing compilation to fail.
getJavSqlType()
First,
schemacrawler.schema.JavaSqlType
has lost itsgetJavaSqlType()
method. Can you tell us what we should put instead ? We were using it to test its kind of type (text vs. numeric vs. binary, see sample below :SchemaCrawlerOptions refactoring
SchemaCrawlerOptions
also had a big refactoring, the following code cannot run anymore, could you please provide us some guidelines ?