- Type Parameters:
- T- The Java type associated with this SQL data type
- All Superinterfaces:
- Named,- QueryPart,- Serializable
- All Known Implementing Classes:
- BuiltInDataType,- DefaultDataType
 jOOQ provides built in data types through SQLDataType. Users can
 define their own data types programmatically by calling
 asConvertedDataType(Converter) or
 asConvertedDataType(Binding), for example. Custom data types can
 also be defined on generated code using the <forcedType/>
 configuration, see the manual for more details
- Author:
- Lukas Eder
- 
Method SummaryModifier and TypeMethodDescription<A extends ArrayRecord<?>>
 @NotNull DataType<A>asArrayDataType(Class<A> arrayDataType) Retrieve the data type for an Oracle-style ARRAY of this data type.<A extends AssociativeArrayRecord<?,?>> 
 @NotNull DataType<A>asAssociativeArrayDataType(Class<A> arrayDataType) Retrieve the data type for an Oracle-style associative array of this data type.default <U> @NotNull DataType<U>asConvertedDataType(Class<U> toType, Function<? super T, ? extends U> from, Function<? super U, ? extends T> to) Convenience method for converting this type usingConverter.of(Class, Class, Function, Function).<U> @NotNull DataType<U>asConvertedDataType(Binding<? super T, U> binding) Retrieve the data type for a given binding.<U> @NotNull DataType<U>asConvertedDataType(Converter<? super T, U> converter) Retrieve the data type for a given converter.default <U> @NotNull DataType<U>asConvertedDataTypeFrom(Class<U> toType, Function<? super T, ? extends U> from) Convenience method for converting this type to a read-only type usingConverter.from(Class, Class, Function).default <U> @NotNull DataType<U>asConvertedDataTypeFrom(Function<? super T, ? extends U> from) Convenience method for converting this type to a read-only type usingConverter.from(Class, Class, Function).default <U> @NotNull DataType<U>asConvertedDataTypeTo(Class<U> toType, Function<? super U, ? extends T> to) Convenience method for converting this type to a write-only type usingConverter.to(Class, Class, Function).default <U> @NotNull DataType<U>asConvertedDataTypeTo(Function<? super U, ? extends T> to) Convenience method for converting this type to a write-only type usingConverter.to(Class, Class, Function).asEnumDataType(Class<E> enumDataType) Retrieve the data type for a given enum data type.@Nullable CharacterSetGet the character set of this data type, ornullif there is no character set, or if the default character set applies.characterSet(CharacterSet characterSet) Return a new data type like this, with a new character set.@Nullable CollationGet the collation of this data type, ornullif there is no collation, or if the default collation applies.Return a new data type like this, with a new collation.booleancomputed()Whether this column is computed.booleanWhether this column is computed on the client.booleanWhether this column is computed on the client.booleancomputedOnClientStoredOn(GeneratorStatementType statementType) Whether this column is computed on the client.booleanWhether this column is computed on the client.booleanWhether this column is computed on the server.Convert an arbitrary object into<T>.T @NotNull []Convert an arbitrary set of objects into<T>.convert(Collection<?> objects) Convert an arbitrary set of objects into<T>.default_()The expression to be applied as theDEFAULTvalue for this data type.Specify an expression to be applied as theDEFAULTvalue for this data type.Specify an expression to be applied as theDEFAULTvalue for this data type.booleanGet the defaultability of this data type.defaulted(boolean defaulted) Deprecated, for removal: This API element is subject to removal in a future version.The expression to be applied as theDEFAULTvalue for this data type.defaultValue(Field<T> defaultValue) Specify an expression to be applied as theDEFAULTvalue for this data type.defaultValue(T defaultValue) Specify an expression to be applied as theDEFAULTvalue for this data type.Get the computed column expression of this data type, if any.generatedAlwaysAs(Field<T> generatedAlwaysAsValue) Set the computed column expression of this data type to a constant expression.generatedAlwaysAs(Generator<?, ?, T> generatedAlwaysAsValue) Set the computed column expression of this data type to a dynamic expression.generatedAlwaysAs(T generatedAlwaysAsValue) Set the computed column expression of this data type to a constant value.Get the computed column expression of this data type, if any.@NotNull QOM.GenerationLocationGet theQOM.GenerationLocationof the computed column expression of this data type, if any.generationLocation(QOM.GenerationLocation generationOption) Set thegenerationLocation()of the computed column expression.@NotNull QOM.GenerationOptionGet theQOM.GenerationOptionof the computed column expression of this data type, if any.generationOption(QOM.GenerationOption generationOption) Set thegenerationOption()of the computed column expression.@Nullable DataType<?>Retrieve the Java component data type if this is an ARRAY type, ornull, otherwise.@Nullable Class<?>Retrieve the Java component type if this is an ARRAY type, ornull, otherwise.Retrieve the data type for an ARRAY of this data type.Retrieve the Java type associated with ARRAYs of this data type.Get the data type binding associated with this data type.@NotNull StringRetrieve the dialect-specific type name associated with this data type used for casting.@NotNull StringgetCastTypeName(Configuration configuration) Retrieve the dialect-specific type name associated with this data type used for casting.Get the converter associated with this data type.getDataType(Configuration configuration) The dialect-specific data type representing this data type.@Nullable SQLDialectRetrieve the underlyingSQLDialect.Get the defining DOMAIN type orNULLif there is no such type.@NotNull Class<?>TheConverter.fromType()(or database type) in case thisDataTypehas a converter.Get the nested record's record type definition, if this is aisRecord(), or aisMultiset(), orNULLotherwise.@Nullable RowgetRow()Get the nested record'sRowdefinition, if this is aisRecord(), or aisMultiset(), orNULLotherwise.Get the standard SQL data type of this (dialect-specific) data type if available.intGet JDBCTypesvalue.intgetSQLType(Configuration configuration) Get the dialect-specific JDBCTypesvalue.TheConverter.toType()(or user type) in case thisDataTypehas a converter.getType()Retrieve the Java type associated with this data type.@NotNull StringRetrieve the dialect-specific type name associated with this data type.@NotNull StringgetTypeName(Configuration configuration) Retrieve the dialect-specific type name associated with this data type.booleanWhether this data type has a length.booleanWhether this data type has a precision.booleanhasScale()Whether this data type has a scale.booleanidentity()Get the identity flag of this data type.identity(boolean identity) Return a new data type like this, with a new identity flag.booleanisArray()Whether this data type is an array type.booleanWhether this data type is an array type.booleanisBinary()Whether this data type is any binary type.booleanisDate()Whether this data type is any date type.booleanWhether this data type is any date or time type.booleanWhether this data type is any decimal numeric data type.booleanWhether this data type is an embeddable type.booleanisEnum()Whether this data type is an enum type.booleanisFloat()Whether this data type is any floating point data type.booleanWhether this data type is any integer data type.booleanWhether this data type is any interval type.booleanisJSON()Whether this data type is a JSON type.booleanisLob()Whether this data type is best deserialised as aLOB.booleanWhether this data type is a nested collection type.booleanWhether this data type is any national character data type.booleanWhether this data type is any numeric data type.booleanisOther()Whether this data type is an OTHER type.booleanisRecord()Whether this data type is a nested record type.booleanisRowId()Whether this data type is aRowIdtype.booleanWhether this data type is a spatial type.booleanisString()Whether this data type is any character data type.booleanWhether this data type is any date or time type.booleanisTime()Whether this data type is any time type.booleanWhether this data type is any timestamp type.booleanWhether this data type is any timestamp type.booleanWhether this data type is any time type.booleanisUDT()Whether this data type is a UDT type.booleanisXML()Whether this data type is an XML type.intlength()Get the length of this data type.length(int length) Return a new data type like this, with a new length value.booleanWhether the precision returned bylength()is defined.notNull()Synonym fornullable(boolean), passingfalseas an argument.null_()Synonym fornullable(boolean), passingtrueas an argument.@NotNull NullabilityGet the nullability of this data type.nullability(Nullability nullability) Return a new data type like this, with a new nullability.booleannullable()Get the nullability of this data type.nullable(boolean nullable) Return a new data type like this, with a new nullability.intGet the precision of this data type.precision(int precision) Return a new data type like this, with a new precision value.precision(int precision, int scale) Return a new data type like this, with a new precision and scale value.booleanWhether the precision returned byprecision()is defined.booleanreadonly()Get the readonly attribute of this data type.readonly(boolean readonly) Return a new data type like this, with a new readonly attribute.booleanGet the readonly attribute of this data type, combined with other flags that influence readonly behaviour.intscale()Get the scale of this data type.scale(int scale) Return a new data type like this, with a new scale value.booleanWhether the precision returned byscale()is defined.stored()Set thegenerationOption()of the computed column expression toQOM.GenerationOption.STORED.virtual()Set thegenerationOption()of the computed column expression toQOM.GenerationOption.VIRTUAL.Methods inherited from interface org.jooq.Named$name, getComment, getCommentPart, getName, getQualifiedName, getUnqualifiedName
- 
Method Details- 
getSQLDataTypeGet the standard SQL data type of this (dialect-specific) data type if available.
- 
getDataTypeThe dialect-specific data type representing this data type.
- 
getSQLTypeint getSQLType()Get JDBCTypesvalue.
- 
getSQLTypeGet the dialect-specific JDBCTypesvalue.
- 
getBindingGet the data type binding associated with this data type.
- 
getConverterGet the converter associated with this data type.
- 
getTypeRetrieve the Java type associated with this data type.This is the same as #getUserType().
- 
getFromTypeTheConverter.fromType()(or database type) in case thisDataTypehas a converter.
- 
getToTypeTheConverter.toType()(or user type) in case thisDataTypehas a converter.
- 
getDomainGet the defining DOMAIN type orNULLif there is no such type.
- 
getRowGet the nested record'sRowdefinition, if this is aisRecord(), or aisMultiset(), orNULLotherwise.
- 
getRecordTypeGet the nested record's record type definition, if this is aisRecord(), or aisMultiset(), orNULLotherwise.
- 
getArrayTypeRetrieve the Java type associated with ARRAYs of this data type.
- 
getArrayDataTypeRetrieve the data type for an ARRAY of this data type.Built-in data types, as well as custom data types that have a custom getConverter()can be translated to array data types usingConverter.forArrays(). Data types with customgetBinding()cannot be translated to an array data type. Use this idiom, instead:// Doesn't work DataType<UserType[]> t1 = SQLDataType.INTEGER.asConvertedDataType(binding).getArrayDataType(); // Works DataType<UserType[]> t2 = SQLDataType.INTEGER.getArrayDataType().asConvertedDataType(arrayBinding);- Throws:
- DataTypeException- When this data type has a custom- getBinding(), which cannot be automatically translated to an array- Binding.
 
- 
getArrayComponentTypeRetrieve the Java component type if this is an ARRAY type, ornull, otherwise.
- 
getArrayComponentDataTypeRetrieve the Java component data type if this is an ARRAY type, ornull, otherwise.
- 
asArrayDataType@NotNull @Pro <A extends ArrayRecord<?>> @NotNull DataType<A> asArrayDataType(Class<A> arrayDataType) Retrieve the data type for an Oracle-style ARRAY of this data type.
- 
asAssociativeArrayDataType@NotNull @Pro <A extends AssociativeArrayRecord<?,?>> @NotNull DataType<A> asAssociativeArrayDataType(Class<A> arrayDataType) Retrieve the data type for an Oracle-style associative array of this data type.
- 
asEnumDataTypeRetrieve the data type for a given enum data type.
- 
asConvertedDataTypeRetrieve the data type for a given converter.
- 
asConvertedDataType@NotNull default <U> @NotNull DataType<U> asConvertedDataType(Class<U> toType, Function<? super T, ? extends U> from, Function<? super U, ? extends T> to) Convenience method for converting this type usingConverter.of(Class, Class, Function, Function).
- 
asConvertedDataTypeFrom@NotNull default <U> @NotNull DataType<U> asConvertedDataTypeFrom(Class<U> toType, Function<? super T, ? extends U> from) Convenience method for converting this type to a read-only type usingConverter.from(Class, Class, Function).
- 
asConvertedDataTypeFrom@NotNull default <U> @NotNull DataType<U> asConvertedDataTypeFrom(Function<? super T, ? extends U> from) Convenience method for converting this type to a read-only type usingConverter.from(Class, Class, Function).Unlike asConvertedDataTypeFrom(Class, Function), this method attempts to work without an explicitClassreference for the underlyingConverter.toType(). There may be some edge cases where this doesn't work (e.g. when arrays are involved), in case of which, an explicit class literal should be passed.
- 
asConvertedDataTypeTo@NotNull default <U> @NotNull DataType<U> asConvertedDataTypeTo(Class<U> toType, Function<? super U, ? extends T> to) Convenience method for converting this type to a write-only type usingConverter.to(Class, Class, Function).
- 
asConvertedDataTypeToConvenience method for converting this type to a write-only type usingConverter.to(Class, Class, Function).Unlike asConvertedDataTypeTo(Class, Function), this method attempts to work without an explicitClassreference for the underlyingConverter.toType(). There may be some edge cases where this doesn't work (e.g. when arrays are involved), in case of which, an explicit class literal should be passed.
- 
asConvertedDataTypeRetrieve the data type for a given binding.
- 
getTypeNameRetrieve the dialect-specific type name associated with this data type.
- 
getTypeNameRetrieve the dialect-specific type name associated with this data type.
- 
getCastTypeNameRetrieve the dialect-specific type name associated with this data type used for casting.This is useful for some dialects that have specialised type names for cast expressions. Other dialects require type-length binding when casting, (e.g. VARCHAR(32767)) 
- 
getCastTypeNameRetrieve the dialect-specific type name associated with this data type used for casting.This is useful for some dialects that have specialised type names for cast expressions. Other dialects require type-length binding when casting, (e.g. VARCHAR(32767)) 
- 
getDialectRetrieve the underlyingSQLDialect.
- 
convertConvert an arbitrary object into<T>.See Convert#convert(Object, Class)for details about conversion rules. Notice this does not pass through anyConfiguration.converterProvider().- Parameters:
- object- The object to be converted
- Returns:
- The converted object
- Throws:
- DataTypeException- If conversion fails.
 
- 
convertConvert an arbitrary set of objects into<T>.See Convert#convert(Object, Class)for details about conversion rules. Notice this does not pass through anyConfiguration.converterProvider().- Parameters:
- objects- The objects to be converted
- Returns:
- The converted objects
- Throws:
- DataTypeException- If conversion fails.
 
- 
convertConvert an arbitrary set of objects into<T>.See Convert#convert(Object, Class)for details about conversion rules. Notice this does not pass through anyConfiguration.converterProvider().- Parameters:
- objects- The objects to be converted
- Returns:
- The converted objects
- Throws:
- DataTypeException- If conversion fails.
 
- 
nullabilityReturn a new data type like this, with a new nullability.[#5709] A nullablecolumn cannot have anidentity().- Parameters:
- nullability- The new nullability
- Returns:
- The new data type
 
- 
nullabilityGet the nullability of this data type.- Returns:
- The nullability
 
- 
nullableReturn a new data type like this, with a new nullability.This is the same as calling nullability(Nullability)with any ofNullability.NULLorNullability.NOT_NULLas an argument.[#5709] A nullablecolumn cannot have anidentity().- Parameters:
- nullable- The new nullability
- Returns:
- The new data type
 
- 
nullableboolean nullable()Get the nullability of this data type.This returns trueby default, i.e. ifnullability()isNullability.DEFAULT.- Returns:
- The nullability
 
- 
readonlyReturn a new data type like this, with a new readonly attribute.This feature is implemented in commercial distributions only. - Parameters:
- readonly- The new readonly attribute value.
- Returns:
- The new data type
 
- 
readonlyboolean readonly()Get the readonly attribute of this data type.This feature is implemented in commercial distributions only. 
- 
readonlyInternalboolean readonlyInternal()Get the readonly attribute of this data type, combined with other flags that influence readonly behaviour.A column may be marked as readonly()for various reasons, including:- When it is marked as readonly explicitly by the code generator.
- When it is marked as readonly implicitly because it's a computed
 column with QOM.GenerationLocation.SERVERor withQOM.GenerationLocation.CLIENTandQOM.GenerationOption.VIRTUAL.
 Some columns are readonly for users, meaning users of the jOOQ API cannot write to them, but jOOQ, internally, may still write to those columns. Such columns may include: - Columns that are computed with QOM.GenerationLocation.CLIENTandQOM.GenerationOption.STORED
- Columns used for optimistic locking
 This feature is implemented in commercial distributions only. 
- 
computedboolean computed()Whether this column is computed.This feature is implemented in commercial distributions only. 
- 
computedOnServerboolean computedOnServer()Whether this column is computed on the server.This is true only if all of these hold true: This feature is implemented in commercial distributions only. 
- 
computedOnClientboolean computedOnClient()Whether this column is computed on the client.This is true only if all of these hold true: This feature is implemented in commercial distributions only. 
- 
computedOnClientStoredboolean computedOnClientStored()Whether this column is computed on the client.This is true only if all of these hold true: - computed()
- generationLocation()==- QOM.GenerationLocation.CLIENT
- generationOption()==- QOM.GenerationOption.STORED
- generatedAlwaysAsGenerator()produces a generator that- Generator.supports(GeneratorStatementType)any of- GeneratorStatementType.INSERTor- GeneratorStatementType.UPDATE
 This feature is implemented in commercial distributions only. 
- 
computedOnClientStoredOnWhether this column is computed on the client.This is true only if all of these hold true: - computed()
- generationLocation()==- QOM.GenerationLocation.CLIENT
- generationOption()==- QOM.GenerationOption.STORED
- generatedAlwaysAsGenerator()produces a generator that- Generator.supports(GeneratorStatementType)the argument- statementType
 This feature is implemented in commercial distributions only. 
- 
computedOnClientVirtualboolean computedOnClientVirtual()Whether this column is computed on the client.This is true only if all of these hold true: - computed()
- generationLocation()==- QOM.GenerationLocation.CLIENT
- generationOption()==- QOM.GenerationOption.VIRTUAL
- generatedAlwaysAsGenerator()produces a generator that- Generator.supports(GeneratorStatementType)the type- GeneratorStatementType.SELECT
 This feature is implemented in commercial distributions only. 
- 
generatedAlwaysAs@NotNull @Support({AURORA_POSTGRES,COCKROACHDB,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,MARIADB,MYSQL_5_7,ORACLE12C,POSTGRES_12,SQLSERVER}) @NotNull DataType<T> generatedAlwaysAs(T generatedAlwaysAsValue) Set the computed column expression of this data type to a constant value.This implicitly sets readonly()totrue.This feature is implemented in commercial distributions only. 
- 
generatedAlwaysAs@NotNull @Support({AURORA_POSTGRES,COCKROACHDB,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,MARIADB,MYSQL_5_7,ORACLE12C,POSTGRES_12,SQLSERVER}) @NotNull DataType<T> generatedAlwaysAs(Field<T> generatedAlwaysAsValue) Set the computed column expression of this data type to a constant expression.This implicitly sets readonly()totrue.This feature is implemented in commercial distributions only. 
- 
generatedAlwaysAsSet the computed column expression of this data type to a dynamic expression.Unlike generatedAlwaysAs(Object)andgeneratedAlwaysAs(Field), which produce a constant value or expression, this allows for generating a dynamic expression if used along withgenerationLocation()andQOM.GenerationLocation.CLIENT, in order to implement client side computed columns.If generationLocation()isQOM.GenerationLocation.SERVER, then this does not affect generated DML statements, and will be evaluated only in DDL statements, when creating the table.This implicitly sets readonly()totrue.This feature is implemented in commercial distributions only. 
- 
generatedAlwaysAsGet the computed column expression of this data type, if any.This eagerly evaluates the generatedAlwaysAsGenerator()generator, which may not produce the same expression upon execution of a query, in casegenerationLocation()isQOM.GenerationLocation.CLIENT. The behaviour ofQOM.GenerationLocation.SERVERis not affected. The method has been left unmodified for backwards compatibility with jOOQ 3.16.This feature is implemented in commercial distributions only. 
- 
generatedAlwaysAsGeneratorGet the computed column expression of this data type, if any.This feature is implemented in commercial distributions only. 
- 
stored@NotNull @Support({AURORA_POSTGRES,COCKROACHDB,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,MARIADB,MYSQL_5_7,ORACLE12C,POSTGRES_12,SQLSERVER}) @NotNull DataType<T> stored()Set thegenerationOption()of the computed column expression toQOM.GenerationOption.STORED.If not supported by the dialect, this will be ignored. This feature is implemented in commercial distributions only. 
- 
virtual@NotNull @Support({AURORA_POSTGRES,COCKROACHDB,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,MARIADB,MYSQL_5_7,ORACLE12C,POSTGRES_12,SQLSERVER}) @NotNull DataType<T> virtual()Set thegenerationOption()of the computed column expression toQOM.GenerationOption.VIRTUAL.If not supported by the dialect, this will be ignored. This feature is implemented in commercial distributions only. 
- 
generationOption@NotNull @Support({AURORA_POSTGRES,COCKROACHDB,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,MARIADB,MYSQL_5_7,ORACLE12C,POSTGRES_12,SQLSERVER}) @NotNull DataType<T> generationOption(QOM.GenerationOption generationOption) Set thegenerationOption()of the computed column expression.If not supported by the dialect, this will be ignored. This feature is implemented in commercial distributions only. 
- 
generationOptionGet theQOM.GenerationOptionof the computed column expression of this data type, if any.This feature is implemented in commercial distributions only. 
- 
generationLocationSet thegenerationLocation()of the computed column expression.Specifies whether the generatedAlwaysAs()expression is computed on theQOM.GenerationLocation.SERVER(by default) or in theQOM.GenerationLocation.CLIENT. The latter is supported in all dialects, the former only in relevant dialects.The computation happens in Insert,Update, orMergestatements in casegenerationOption()isQOM.GenerationOption.STORED, or inSelectin case thegenerationOption()isQOM.GenerationOption.VIRTUAL.This feature is implemented in commercial distributions only. 
- 
generationLocationGet theQOM.GenerationLocationof the computed column expression of this data type, if any.Specifies whether the generatedAlwaysAs()expression is computed on theQOM.GenerationLocation.SERVER(by default) or in theQOM.GenerationLocation.CLIENT. The latter is supported in all dialects, the former only in relevant dialects.The computation happens in Insert,Update, orMergestatements in casegenerationOption()isQOM.GenerationOption.STORED, or inSelectin case thegenerationOption()isQOM.GenerationOption.VIRTUAL.This feature is implemented in commercial distributions only. 
- 
null_Synonym fornullable(boolean), passingtrueas an argument.
- 
notNullSynonym fornullable(boolean), passingfalseas an argument.
- 
collation@NotNull @Support({AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,YUGABYTEDB}) @NotNull DataType<T> collation(Collation collation) Return a new data type like this, with a new collation.
- 
collationGet the collation of this data type, ornullif there is no collation, or if the default collation applies.
- 
characterSet@NotNull @Support({AURORA_MYSQL,MARIADB,MEMSQL,MYSQL}) @NotNull DataType<T> characterSet(CharacterSet characterSet) Return a new data type like this, with a new character set.
- 
characterSetGet the character set of this data type, ornullif there is no character set, or if the default character set applies.
- 
identity@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2,DERBY,EXASOL,FIREBIRD_3_0,H2,HANA,HSQLDB,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,VERTICA,YUGABYTEDB}) @NotNull DataType<T> identity(boolean identity) Return a new data type like this, with a new identity flag.[#5709] The IDENTITY flag imposes a NOT NULL constraint, and removes all DEFAULT values. - Parameters:
- identity- The new identity flag
- Returns:
- The new data type
 
- 
identityboolean identity()Get the identity flag of this data type.- Returns:
- The identity flag.
 
- 
defaultValue@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,DB2,DERBY,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,VERTICA,YUGABYTEDB}) @NotNull DataType<T> defaultValue(T defaultValue) Specify an expression to be applied as theDEFAULTvalue for this data type.[#5709] A defaultedcolumn cannot have anidentity().This is an alias for default_(Object).- See Also:
 
- 
defaultValue@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,DB2,DERBY,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,VERTICA,YUGABYTEDB}) @NotNull DataType<T> defaultValue(Field<T> defaultValue) Specify an expression to be applied as theDEFAULTvalue for this data type.A default value of a data type applies to DDL statements, such as - CREATE TABLE
- ALTER TABLE
 The distinct types of possible DEFAULTexpressions is defined by the underlying database. Please refer to your database manual to learn what expressions are possible.This is an alias for default_(Field).
- 
defaultValueThe expression to be applied as theDEFAULTvalue for this data type.This is an alias for default_().- Returns:
- The default value if present, or nullif no default value is specified for this data type.
- See Also:
 
- 
default_@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,DB2,DERBY,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,VERTICA,YUGABYTEDB}) @NotNull DataType<T> default_(T defaultValue) Specify an expression to be applied as theDEFAULTvalue for this data type.[#5709] A defaultedcolumn cannot have anidentity().- See Also:
 
- 
default_@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,DB2,DERBY,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,VERTICA,YUGABYTEDB}) @NotNull DataType<T> default_(Field<T> defaultValue) Specify an expression to be applied as theDEFAULTvalue for this data type.A default value of a data type applies to DDL statements, such as - CREATE TABLE
- ALTER TABLE
 The distinct types of possible DEFAULTexpressions is defined by the underlying database. Please refer to your database manual to learn what expressions are possible.
- 
default_The expression to be applied as theDEFAULTvalue for this data type.- Returns:
- The default value if present, or nullif no default value is specified for this data type.
- See Also:
 
- 
defaulted@NotNull @Deprecated(forRemoval=true, since="3.8") @NotNull DataType<T> defaulted(boolean defaulted) Deprecated, for removal: This API element is subject to removal in a future version.- [#3852] - 3.8.0 - UsedefaultValue(Field)instead.Return a new data type like this, with a new defaultability.- Parameters:
- defaulted- The new defaultability
- Returns:
- The new data type
 
- 
defaultedboolean defaulted()Get the defaultability of this data type.- Returns:
- The defaultability
 
- 
precisionReturn a new data type like this, with a new precision value.This will have no effect if hasPrecision()isfalseThis is the same as calling precision(int, int)withscale == 0- Parameters:
- precision- The new precision value
- Returns:
- The new data type
 
- 
precisionReturn a new data type like this, with a new precision and scale value.This will have no effect if hasPrecision()isfalse, or ifscale > 0andhasScale()isfalse- Parameters:
- precision- The new precision value
- scale- The new scale value
- Returns:
- The new data type
 
- 
precisionint precision()Get the precision of this data type.- Returns:
- The precision of this data type
 
- 
hasPrecisionboolean hasPrecision()Whether this data type has a precision.- Returns:
- Whether this data type has a precision
 
- 
precisionDefinedboolean precisionDefined()Whether the precision returned byprecision()is defined.The default precision is 0for all data types. If a data type does not have a precision (seehasPrecision()), or if it was initialised without precision (e.g.SQLDataType.TIMESTAMP), then the precision is not defined.
- 
scaleReturn a new data type like this, with a new scale value.This will have no effect if hasScale()isfalse- Parameters:
- scale- The new scale value
- Returns:
- The new data type
 
- 
scaleint scale()Get the scale of this data type.- Returns:
- The scale of this data type
 
- 
hasScaleboolean hasScale()Whether this data type has a scale.- Returns:
- Whether this data type has a scale
 
- 
scaleDefinedboolean scaleDefined()Whether the precision returned byscale()is defined.The default scale is 0for all data types. If a data type does not have a scale (seehasScale()), or if it was initialised without scale (e.g.SQLDataType.TIMESTAMP), then the scale is not defined.
- 
lengthReturn a new data type like this, with a new length value.This will have no effect if hasLength()isfalse- Parameters:
- length- The new length value
- Returns:
- The new data type
 
- 
lengthint length()Get the length of this data type.- Returns:
- The length of this data type
 
- 
hasLengthboolean hasLength()Whether this data type has a length.- Returns:
- Whether this data type has a length
 
- 
lengthDefinedboolean lengthDefined()Whether the precision returned bylength()is defined.The default length is 0for all data types. If a data type does not have a length (seehasLength()), or if it was initialised without length (e.g.SQLDataType.TIMESTAMP), then the length is not defined.
- 
isNumericboolean isNumeric()Whether this data type is any numeric data type.This applies to any of these types: - See Also:
 
- 
isIntegerboolean isInteger()Whether this data type is any integer data type.This applies to any of these types: 
- 
isFloatboolean isFloat()Whether this data type is any floating point data type.This applies to any of these types: 
- 
isDecimalboolean isDecimal()Whether this data type is any decimal numeric data type.This applies to any of these types: 
- 
isStringboolean isString()Whether this data type is any character data type.This applies to any of these types: 
- 
isNStringboolean isNString()Whether this data type is any national character data type.This applies to any of these types: 
- 
isDateTimeboolean isDateTime()Whether this data type is any date or time type.This applies to any of these types. - See Also:
 
- 
isDateboolean isDate()Whether this data type is any date type.This applies to any of these types. 
- 
isTimestampboolean isTimestamp()Whether this data type is any timestamp type.This applies to any of these types. 
- 
isTimestampWithTimeZoneboolean isTimestampWithTimeZone()Whether this data type is any timestamp type.This applies to any of these types. 
- 
isTimeboolean isTime()Whether this data type is any time type.This applies to any of these types. 
- 
isTimeWithTimeZoneboolean isTimeWithTimeZone()Whether this data type is any time type.This applies to any of these types. 
- 
isTemporalboolean isTemporal()Whether this data type is any date or time type.This applies to any of these types. -  SQLDataType.DATE
-  SQLDataType.TIME
-  SQLDataType.TIMESTAMP
-  SQLDataType.LOCALDATE
-  SQLDataType.LOCALTIME
-  SQLDataType.LOCALDATETIME
-  SQLDataType.OFFSETTIME
-  SQLDataType.OFFSETDATETIME
-  SQLDataType.INSTANT
-  YearToSecond
-  YearToMonth
-  DayToSecond
 This is a combination of isDateTime()orisInterval()
-  
- 
isIntervalboolean isInterval()Whether this data type is any interval type.This applies to any of these types. 
- 
isBinaryboolean isBinary()Whether this data type is any binary type.This applies to any of these types. 
- 
isLobboolean isLob()Whether this data type is best deserialised as aLOB.This applies to any of these types. 
- 
isArrayboolean isArray()Whether this data type is an array type.
- 
isAssociativeArrayboolean isAssociativeArray()Whether this data type is an array type.
- 
isEmbeddableboolean isEmbeddable()Whether this data type is an embeddable type.
- 
isUDTboolean isUDT()Whether this data type is a UDT type.
- 
isRecordboolean isRecord()Whether this data type is a nested record type.This is true for anonymous, structural nested record types constructed with DSL.row(SelectField...)or for nominal nested record types, such asisUDT()orisEmbeddable().
- 
isMultisetboolean isMultiset()Whether this data type is a nested collection type.This is true for anonymous, structural nested collection types constructed with DSL#multiset(Select)orDSL.multisetAgg(Field...).
- 
isEnumboolean isEnum()Whether this data type is an enum type.
- 
isJSONboolean isJSON()Whether this data type is a JSON type.
- 
isXMLboolean isXML()Whether this data type is an XML type.
- 
isSpatialboolean isSpatial()Whether this data type is a spatial type.
- 
isRowIdboolean isRowId()Whether this data type is aRowIdtype.
- 
isOtherboolean isOther()Whether this data type is an OTHER type.The SQLDataType.OTHERtype maps any unknown data types to a jOOQDataType. This includes unknown vendor specific types as well as unknown user defined types which do not have any customConverterorBindingattached. The type may still be usable with the jOOQ API, but jOOQ's behaviour may not be well defined. Please note that any future minor release may add support for a vendor specific type, meaning the type loses its "otherness."
 
- 
defaultValue(Field)instead.