[#5575] Add support for H2's TO_DATE() and TO_TIMESTAMP() function
This commit is contained in:
parent
a548c82298
commit
cefa1cd487
@ -12042,7 +12042,7 @@ public class DSL {
|
||||
* @param value The formatted <code>DATE</code> value.
|
||||
* @param format The vendor-specific formatting string.
|
||||
*/
|
||||
@Support({ POSTGRES })
|
||||
@Support({ H2, POSTGRES })
|
||||
public static Field<Date> toDate(String value, String format) {
|
||||
return toDate(Tools.field(value, SQLDataType.VARCHAR), Tools.field(format, SQLDataType.VARCHAR));
|
||||
}
|
||||
@ -12053,7 +12053,7 @@ public class DSL {
|
||||
* @param value The formatted <code>DATE</code> value.
|
||||
* @param format The vendor-specific formatting string.
|
||||
*/
|
||||
@Support({ POSTGRES })
|
||||
@Support({ H2, POSTGRES })
|
||||
public static Field<Date> toDate(String value, Field<String> format) {
|
||||
return toDate(Tools.field(value, SQLDataType.VARCHAR), nullSafe(format));
|
||||
}
|
||||
@ -12064,7 +12064,7 @@ public class DSL {
|
||||
* @param value The formatted <code>DATE</code> value.
|
||||
* @param format The vendor-specific formatting string.
|
||||
*/
|
||||
@Support({ POSTGRES })
|
||||
@Support({ H2, POSTGRES })
|
||||
public static Field<Date> toDate(Field<String> value, String format) {
|
||||
return toDate(nullSafe(value), Tools.field(format, SQLDataType.VARCHAR));
|
||||
}
|
||||
@ -12075,9 +12075,9 @@ public class DSL {
|
||||
* @param value The formatted <code>DATE</code> value.
|
||||
* @param format The vendor-specific formatting string.
|
||||
*/
|
||||
@Support({ POSTGRES })
|
||||
@Support({ H2, POSTGRES })
|
||||
public static Field<Date> toDate(Field<String> value, Field<String> format) {
|
||||
return DSL.field("to_date({0}, {1})", SQLDataType.DATE, nullSafe(value), nullSafe(format));
|
||||
return DSL.field("{to_date}({0}, {1})", SQLDataType.DATE, nullSafe(value), nullSafe(format));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -12086,7 +12086,7 @@ public class DSL {
|
||||
* @param value The formatted <code>TIMESTAMP</code> value.
|
||||
* @param format The vendor-specific formatting string.
|
||||
*/
|
||||
@Support({ POSTGRES })
|
||||
@Support({ H2, POSTGRES })
|
||||
public static Field<Timestamp> toTimestamp(String value, String format) {
|
||||
return toTimestamp(Tools.field(value, SQLDataType.VARCHAR), Tools.field(format, SQLDataType.VARCHAR));
|
||||
}
|
||||
@ -12097,7 +12097,7 @@ public class DSL {
|
||||
* @param value The formatted <code>TIMESTAMP</code> value.
|
||||
* @param format The vendor-specific formatting string.
|
||||
*/
|
||||
@Support({ POSTGRES })
|
||||
@Support({ H2, POSTGRES })
|
||||
public static Field<Timestamp> toTimestamp(String value, Field<String> format) {
|
||||
return toTimestamp(Tools.field(value, SQLDataType.VARCHAR), nullSafe(format));
|
||||
}
|
||||
@ -12108,7 +12108,7 @@ public class DSL {
|
||||
* @param value The formatted <code>TIMESTAMP</code> value.
|
||||
* @param format The vendor-specific formatting string.
|
||||
*/
|
||||
@Support({ POSTGRES })
|
||||
@Support({ H2, POSTGRES })
|
||||
public static Field<Timestamp> toTimestamp(Field<String> value, String format) {
|
||||
return toTimestamp(nullSafe(value), Tools.field(format, SQLDataType.VARCHAR));
|
||||
}
|
||||
@ -12119,9 +12119,9 @@ public class DSL {
|
||||
* @param value The formatted <code>TIMESTAMP</code> value.
|
||||
* @param format The vendor-specific formatting string.
|
||||
*/
|
||||
@Support({ POSTGRES })
|
||||
@Support({ H2, POSTGRES })
|
||||
public static Field<Timestamp> toTimestamp(Field<String> value, Field<String> format) {
|
||||
return DSL.field("to_timestamp({0}, {1})", SQLDataType.TIMESTAMP, nullSafe(value), nullSafe(format));
|
||||
return DSL.field("{to_timestamp}({0}, {1})", SQLDataType.TIMESTAMP, nullSafe(value), nullSafe(format));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user