[#4173] NullPointerException when using SQL99 dialect with XMLDatabase

for code generation
This commit is contained in:
lukaseder 2015-04-08 18:42:03 +02:00
parent e69479b8cd
commit c66ef8a4f6
2 changed files with 15 additions and 12 deletions

View File

@ -4429,17 +4429,20 @@ public class JavaGenerator extends AbstractGenerator {
// Otherwise, reference the dialect-specific DataType itself.
else {
String typeClass =
"org.jooq.util." +
db.getDialect().getName().toLowerCase() +
"." +
db.getDialect().getName() +
"DataType";
sb.append(typeClass);
sb.append(".");
try {
// [#4173] DEFAULT and SQL99 data types
String typeClass = (db.getDialect().getName() == null)
? SQLDataType.class.getName()
: "org.jooq.util." +
db.getDialect().getName().toLowerCase() +
"." +
db.getDialect().getName() +
"DataType";
sb.append(typeClass);
sb.append(".");
String type1 = getType(db, schema, t, p, s, u, null);
String type2 = getType(db, schema, t, 0, 0, u, null);
String typeName = DefaultDataType.normalise(t);

View File

@ -66,7 +66,7 @@ public enum SQLDialect {
* pseudo-dialect.
*/
@Deprecated
SQL99(null, false),
SQL99("", false),
/**
* The default SQL dialect.
@ -75,7 +75,7 @@ public enum SQLDialect {
* not intended to be used with any actual database as it may combined
* dialect-specific things from various dialects.
*/
DEFAULT(null, false),
DEFAULT("", false),
// -------------------------------------------------------------------------
// SQL dialects for free usage