[jOOQ/jOOQ#10193] [jOOQ/jOOQ#10192] Support precision on LOCALTIME and

LOCALDATETIME data types
This commit is contained in:
Lukas Eder 2020-05-13 10:29:28 +02:00
parent 37ec8d3a34
commit dd68dab0ac
2 changed files with 18 additions and 0 deletions

View File

@ -57,6 +57,8 @@ import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.OffsetDateTime;
import java.time.OffsetTime;
import java.util.Collection;
@ -538,6 +540,8 @@ public class DefaultDataType<T> implements DataType<T> {
|| tType == Timestamp.class
|| tType == Time.class
|| tType == LocalDateTime.class
|| tType == LocalTime.class
|| tType == OffsetDateTime.class
|| tType == OffsetTime.class
|| tType == Instant.class

View File

@ -437,11 +437,25 @@ public final class SQLDataType {
*/
public static final DataType<LocalTime> LOCALTIME = new DefaultDataType<>(null, LocalTime.class, "time");
/**
* The {@link Types#TIME} type.
*/
public static final DataType<LocalTime> LOCALTIME(int precision) {
return LOCALTIME.precision(precision);
}
/**
* The {@link Types#TIMESTAMP} type.
*/
public static final DataType<LocalDateTime> LOCALDATETIME = new DefaultDataType<>(null, LocalDateTime.class, "timestamp");
/**
* The {@link Types#TIMESTAMP} type.
*/
public static final DataType<LocalDateTime> LOCALDATETIME(int precision) {
return LOCALDATETIME.precision(precision);
}
/**
* The {@link Types#TIME_WITH_TIMEZONE} type.
* <p>