[jOOQ/jOOQ#6497] Add type only in Java 8+ builds
This commit is contained in:
parent
da750890d3
commit
48201965d6
@ -188,13 +188,20 @@ public abstract class AbstractTypedElementDefinition<T extends Definition>
|
||||
// [#5239] [#5762] [#6453] Don't rely on getSQLType()
|
||||
if (SQLDataType.DATE.equals(dataType.getSQLDataType())) {
|
||||
DataType<?> forcedDataType = getDataType(db, SQLDataType.TIMESTAMP.getTypeName(), 0, 0);
|
||||
String binding = DateAsTimestampBinding.class.getName();
|
||||
|
||||
|
||||
if (db.javaTimeTypes())
|
||||
binding = LocalDateAsLocalDateTimeBinding.class.getName();
|
||||
|
||||
|
||||
result = new DefaultDataTypeDefinition(
|
||||
db,
|
||||
child.getSchema(),
|
||||
forcedDataType.getTypeName(),
|
||||
0, 0, 0,
|
||||
result.isNullable(), result.getDefaultValue(), (Name) null, null,
|
||||
db.javaTimeTypes() ? LocalDateAsLocalDateTimeBinding.class.getName() : DateAsTimestampBinding.class.getName()
|
||||
binding
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,6 +37,8 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
|
||||
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.val;
|
||||
import static org.jooq.impl.Keywords.K_AS;
|
||||
@ -137,3 +139,5 @@ public class LocalDateAsLocalDateTimeBinding implements Binding<LocalDateTime, L
|
||||
delegate.get(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user