@Override public final DataType<T> identity(boolean i) { return new DefaultDataType<T>(this, precision, scale, length, i ? NOT_NULL : nullability, collation, i, i ? null : defaultValue); }
@Override public final DataType<T> precision(int p, int s) { if (precision == p && scale == s) { return this; } else { return new DefaultDataType<T>(dialect, sqlDataType, type, typeName, castTypeName, p, s, length, nullable, defaulted); } }
@Override public final DataType<T> scale(int s) { if (scale == s) { return this; } else { return new DefaultDataType<T>(dialect, sqlDataType, type, typeName, castTypeName, precision, s, length, nullable, defaulted); } }
@Override public final DataType<T> length(int l) { if (length == l) { return this; } else { return new DefaultDataType<T>(dialect, sqlDataType, type, typeName, castTypeName, precision, scale, l, nullable, defaulted); } }
public static final DataType<Object> getDefaultDataType(SQLDialect dialect, String typeName) { return new DefaultDataType<Object>(dialect, Object.class, typeName, typeName); }
@Override public final <E extends EnumType> DataType<E> asEnumDataType(Class<E> enumDataType) { return new DefaultDataType<E>(dialect, enumDataType, typeName, castTypeName); }
protected FakeField(String name) { super(name, new DefaultDataType<Object>(SQLDialect.DEFAULT, Object.class, "varchar")); }
@Override public final DataType<T> collation(Collation c) { return new DefaultDataType<T>(this, precision, scale, length, nullability, c, identity, defaultValue); }
@Override public final DataType<T> defaultValue(Field<T> d) { return new DefaultDataType<T>(this, precision, scale, length, nullability, collation, d != null ? false : identity, d); }
@Override public final DataType<T> length(int l) { if (length == l) return this; // [#4120] LOB types are not allowed to have length if (isLob()) return this; else return new DefaultDataType<T>(this, precision, scale, l, nullability, collation, identity, defaultValue); }
@Override public final DataType<T> scale(int s) { if (scale == s) return this; // [#4120] LOB types are not allowed to have scale if (isLob()) return this; else return new DefaultDataType<T>(this, precision, s, length, nullability, collation, identity, defaultValue); }
@Override public final DataType<T> precision(int p, int s) { if (precision == p && scale == s) return this; // [#4120] LOB types are not allowed to have precision else if (isLob()) return this; else return new DefaultDataType<T>(this, p, s, length, nullability, collation, identity, defaultValue); }
@Override public final DataType<T> nullability(Nullability n) { return new DefaultDataType<T>(this, precision, scale, length, n, collation, n.nullable() ? false : identity, defaultValue); }
@Override protected TableField<MySQLCollectionsRecord, String> createOtherField() { return createField(TableFields.OTHER.fieldName, new DefaultDataType<String>(null, String.class, "json"), this, ""); }
@Override protected TableField<Record2<String, NamedToroIndex>, NamedToroIndex> createIndexField(ToroIndexToJsonConverter indexToJsonConverter) { return createField("index", new DefaultDataType<String>(null, String.class, "json") .asConvertedDataType(indexToJsonConverter)); } }
@Override protected TableField<Record2<String, NamedToroIndex>, NamedToroIndex> createIndexField(ToroIndexToJsonConverter indexToJsonConverter) { return createField("index", new DefaultDataType<String>(null, String.class, "text") .asConvertedDataType(indexToJsonConverter)); } }
@SuppressWarnings("rawtypes") @Override public final <E extends EnumType> DataType<E> asEnumDataType(Class<E> enumDataType) { String enumTypeName = Tools.enums(enumDataType)[0].getName(); return new DefaultDataType<E>(dialect, (DataType<E>) null, enumDataType, enumTypeName, enumTypeName, precision, scale, length, nullability, (Field) defaultValue); }
public static <UT extends ScalarValue<?>> DataTypeForScalar<UT> fromScalarValue(Class<UT> type, SubdocValueConverter<String, UT> converter) { return DataTypeForScalar.from(new DefaultDataType<String>(null, String.class, "json"), converter, new JSONBinding<UT>(converter)); }
@Override protected TableField<Record2<String, NamedToroIndex>, NamedToroIndex> createIndexField(ToroIndexToJsonConverter indexToJsonConverter) { return createField("index", new DefaultDataType<>(null, String.class, "jsonb") .asConvertedDataType(new JSONBBinding<>(indexToJsonConverter)), this, ""); } }
public static <UT extends ScalarValue<?>, V extends JsonValue> DataType<UT> fromScalarValue(final Class<UT> type, final ArrayConverter<V, UT> arrayConverter) { Converter<String, UT> converter = new ArrayToJooqConverter<>(type, arrayConverter); return new DefaultDataType<String>(null, String.class, "json").asConvertedDataType(new JSONBinding<UT>(converter)); }