org.jooq.Field.coerce()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中org.jooq.Field.coerce()方法的一些代码示例,展示了Field.coerce()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.coerce()方法的具体详情如下:
包路径:org.jooq.Field
类名称:Field
方法名:coerce

Field.coerce介绍

[英]Coerce this field to another type.

Unlike with casting, coercing doesn't affect the way the database sees a Field's type. This is how coercing affects your SQL:

Bind values

<<$0$>>

Other Field types

<<$1$>>
[中]将此字段强制为其他类型。
与强制转换不同,强制不会影响数据库查看Field类型的方式。以下是强制对SQL的影响:
####绑定值
<<$0$>>
####其他字段类型
<<$1$>>

代码示例

代码示例来源:origin: org.jooq/jooq

@Override
public final <T> Field<T> field(int fieldIndex, Class<T> type) {
  Field<?> result = field(fieldIndex);
  return result == null ? null : result.coerce(type);
}

代码示例来源:origin: org.jooq/jooq

@Override
public final <T> Field<T> field(int fieldIndex, DataType<T> dataType) {
  Field<?> result = field(fieldIndex);
  return result == null ? null : result.coerce(dataType);
}

代码示例来源:origin: org.jooq/jooq

@Override
public final <T> Field<T> field(Name fieldName, Class<T> type) {
  Field<?> result = field(fieldName);
  return result == null ? null : result.coerce(type);
}

代码示例来源:origin: org.jooq/jooq

@Override
public final <T> Field<T> field(String fieldName, Class<T> type) {
  Field<?> result = field(fieldName);
  return result == null ? null : result.coerce(type);
}

代码示例来源:origin: org.jooq/jooq

@Override
public final <T> Field<T> field(String fieldName, DataType<T> dataType) {
  Field<?> result = field(fieldName);
  return result == null ? null : result.coerce(dataType);
}

代码示例来源:origin: org.jooq/jooq

@Override
public final <T> Field<T> field(Name fieldName, DataType<T> dataType) {
  Field<?> result = field(fieldName);
  return result == null ? null : result.coerce(dataType);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Coerce a field to another type.
 *
 * @see #coerce(Field, DataType)
 */
@Support
public static <T> Field<T> coerce(Object value, DataType<T> as) {
  return Tools.field(value).coerce(as);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Parse a value to a <code>DATE</code>.
 *
 * @param value The formatted <code>DATE</code> value.
 * @param format The vendor-specific formatting string.
 */
@Support({ H2, HSQLDB, POSTGRES })
public static Field<LocalDate> toLocalDate(String value, String format) {
  return toDate(value, format).coerce(SQLDataType.LOCALDATE);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Coerce this field to another type.
 *
 * @see #coerce(Field, Class)
 */
@Support
public static <T> Field<T> coerce(Object value, Class<T> as) {
  return Tools.field(value).coerce(as);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Parse a value to a <code>DATE</code>.
 *
 * @param value The formatted <code>DATE</code> value.
 * @param format The vendor-specific formatting string.
 */
@Support({ H2, HSQLDB, POSTGRES })
public static Field<LocalDate> toLocalDate(Field<String> value, String format) {
  return toDate(value, format).coerce(SQLDataType.LOCALDATE);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Parse a value to a <code>DATE</code>.
 *
 * @param value The formatted <code>DATE</code> value.
 * @param format The vendor-specific formatting string.
 */
@Support({ H2, HSQLDB, POSTGRES })
public static Field<LocalDate> toLocalDate(Field<String> value, Field<String> format) {
  return toDate(value, format).coerce(SQLDataType.LOCALDATE);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Parse a value to a <code>TIMESTAMP</code>.
 *
 * @param value The formatted <code>TIMESTAMP</code> value.
 * @param format The vendor-specific formatting string.
 */
@Support({ H2, HSQLDB, POSTGRES })
public static Field<LocalDateTime> toLocalDateTime(String value, Field<String> format) {
  return toTimestamp(value, format).coerce(SQLDataType.LOCALDATETIME);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Parse a value to a <code>TIMESTAMP</code>.
 *
 * @param value The formatted <code>TIMESTAMP</code> value.
 * @param format The vendor-specific formatting string.
 */
@Support({ H2, HSQLDB, POSTGRES })
public static Field<LocalDateTime> toLocalDateTime(Field<String> value, Field<String> format) {
  return toTimestamp(value, format).coerce(SQLDataType.LOCALDATETIME);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Coerce this field to the type of another field.
 *
 * @see #coerce(Field, Field)
 */
@Support
public static <T> Field<T> coerce(Object value, Field<T> as) {
  return Tools.field(value).coerce(as);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Parse a value to a <code>DATE</code>.
 *
 * @param value The formatted <code>DATE</code> value.
 * @param format The vendor-specific formatting string.
 */
@Support({ H2, HSQLDB, POSTGRES })
public static Field<LocalDate> toLocalDate(String value, Field<String> format) {
  return toDate(value, format).coerce(SQLDataType.LOCALDATE);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Parse a value to a <code>TIMESTAMP</code>.
 *
 * @param value The formatted <code>TIMESTAMP</code> value.
 * @param format The vendor-specific formatting string.
 */
@Support({ H2, HSQLDB, POSTGRES })
public static Field<LocalDateTime> toLocalDateTime(String value, String format) {
  return toTimestamp(value, format).coerce(SQLDataType.LOCALDATETIME);
}

代码示例来源:origin: org.jooq/jooq

/**
 * Parse a value to a <code>TIMESTAMP</code>.
 *
 * @param value The formatted <code>TIMESTAMP</code> value.
 * @param format The vendor-specific formatting string.
 */
@Support({ H2, HSQLDB, POSTGRES })
public static Field<LocalDateTime> toLocalDateTime(Field<String> value, String format) {
  return toTimestamp(value, format).coerce(SQLDataType.LOCALDATETIME);
}

代码示例来源:origin: org.jooq/jooq

return nullSafe(field).coerce(as);

代码示例来源:origin: org.jooq/jooq

return nullSafe(field).coerce(as);

代码示例来源:origin: org.jooq/jooq

return nullSafe(field).coerce(as);

相关文章