static final DataType<String> emulateEnumType(DataType<? extends EnumType> type, Object[] enums) { int length = 0; for (Object e : enums) if (((EnumType) e).getLiteral() != null) length = Math.max(length, ((EnumType) e).getLiteral().length()); return VARCHAR(length).nullability(type.nullability()).defaultValue((Field) type.defaultValue()); }
private static final void toSQLDDLTypeDeclarationDefault(Context<?> ctx, DataType<?> type) { if (type.defaulted()) ctx.sql(' ').visit(K_DEFAULT).sql(' ').visit(type.defaultValue()); }
public DefaultDataType(SQLDialect dialect, DataType<T> sqlDataType, String typeName) { this(dialect, sqlDataType, sqlDataType.getType(), typeName, typeName, sqlDataType.precision(), sqlDataType.scale(), sqlDataType.length(), sqlDataType.nullability(), sqlDataType.defaultValue()); }
public DefaultDataType(SQLDialect dialect, DataType<T> sqlDataType, String typeName, String castTypeName) { this(dialect, sqlDataType, sqlDataType.getType(), typeName, castTypeName, sqlDataType.precision(), sqlDataType.scale(), sqlDataType.length(), sqlDataType.nullability(), sqlDataType.defaultValue()); }
dataType = dataType.defaultValue((Field) DSL.field(d, dataType));
type = type.defaultValue(DSL.field(defaultValue, type)); type = type.defaultValue(DSL.field(defaultValue, type)); else type = type.defaultValue(DSL.inline(defaultValue, type));
@SuppressWarnings("unchecked") ConvertedDataType(DataType<T> delegate, Binding<? super T, U> binding) { super( null, binding.converter().toType(), binding, delegate.getTypeName(), delegate.getCastTypeName(), delegate.precision(), delegate.scale(), delegate.length(), delegate.nullability(), (Field<U>) delegate.defaultValue() ); this.delegate = delegate; }
field.getDataType().scale(), field.getDataType().nullable(), create().renderInlined(field.getDataType().defaultValue()), (Name) null );
type = type.defaultValue((Field) toField(ctx, parseConcat(ctx, null))); defaultValue = true; identity = true;
ic.setNumericScale(f.getDataType().scale()); ic.setColumnDefault(DSL.using(configuration).render(f.getDataType().defaultValue())); ic.setIsNullable(f.getDataType().nullable()); ic.setOrdinalPosition(i + 1);
type = type.defaultValue(toField(ctx, parseConcat(ctx, null))); defaultValue = true; continue;