- java.lang.Object
-
- org.jooq.impl.UDTImpl<R>
-
- All Implemented Interfaces:
Serializable
,Named
,Qualified
,QueryPart
,QueryPartInternal
,UDT<R>
@Internal public class UDTImpl<R extends UDTRecord<R>> extends Object implements UDT<R>
A common base type for UDT'sThis type is for JOOQ INTERNAL USE only. Do not reference directly
- Author:
- Lukas Eder
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
accept(Context<?> ctx)
void
bind(BindContext context)
Deprecated.- 3.4.0 - [#2694] - UseQueryPartInternal.accept(Context)
instead.Clause[]
clauses(Context<?> ctx)
Deprecated.- 3.11.0 - [#8179] - This functionality will be removed in the future.protected DSLContext
create()
Deprecated.- 3.11.0 - [#6722] - UseAttachable.configuration()
andConfiguration.dsl()
instead.protected DSLContext
create(Configuration configuration)
Deprecated.- 3.11.0 - [#6722] - UseAttachable.configuration()
andConfiguration.dsl()
instead.protected DSLContext
create(Context<?> ctx)
Deprecated.- 3.11.0 - [#6722] - UseAttachable.configuration()
andConfiguration.dsl()
instead.protected static <R extends UDTRecord<R>,T>
UDTField<R,T>createField(String name, DataType<T> type, UDT<R> udt)
Deprecated.- 3.12.0 - [#8000] - UsecreateField(Name, DataType, UDT)
instead.protected static <R extends UDTRecord<R>,T>
UDTField<R,T>createField(String name, DataType<T> type, UDT<R> udt, String comment)
Deprecated.- 3.12.0 - [#8000] - UsecreateField(Name, DataType, UDT, String)
instead.protected static <R extends UDTRecord<R>,T,U>
UDTField<R,U>createField(String name, DataType<T> type, UDT<R> udt, String comment, Binding<T,U> binding)
Deprecated.- 3.12.0 - [#8000] - UsecreateField(Name, DataType, UDT, String, Binding)
instead.protected static <R extends UDTRecord<R>,T,U>
UDTField<R,U>createField(String name, DataType<T> type, UDT<R> udt, String comment, Converter<T,U> converter)
Deprecated.- 3.12.0 - [#8000] - UsecreateField(Name, DataType, UDT, String, Converter)
instead.protected static <R extends UDTRecord<R>,T,X,U>
UDTField<R,U>createField(String name, DataType<T> type, UDT<R> udt, String comment, Converter<X,U> converter, Binding<T,X> binding)
Deprecated.- 3.12.0 - [#8000] - UsecreateField(Name, DataType, UDT, String, Converter, Binding)
instead.protected static <R extends UDTRecord<R>,T>
UDTField<R,T>createField(Name name, DataType<T> type, UDT<R> udt)
Subclasses may call this method to createUDTField
objects that are linked to this table.protected static <R extends UDTRecord<R>,T>
UDTField<R,T>createField(Name name, DataType<T> type, UDT<R> udt, String comment)
Subclasses may call this method to createUDTField
objects that are linked to this table.protected static <R extends UDTRecord<R>,T,U>
UDTField<R,U>createField(Name name, DataType<T> type, UDT<R> udt, String comment, Binding<T,U> binding)
Subclasses may call this method to createUDTField
objects that are linked to this table.protected static <R extends UDTRecord<R>,T,U>
UDTField<R,U>createField(Name name, DataType<T> type, UDT<R> udt, String comment, Converter<T,U> converter)
Subclasses may call this method to createUDTField
objects that are linked to this table.protected static <R extends UDTRecord<R>,T,X,U>
UDTField<R,U>createField(Name name, DataType<T> type, UDT<R> udt, String comment, Converter<X,U> converter, Binding<T,X> binding)
Subclasses may call this method to createUDTField
objects that are linked to this table.boolean
declaresCTE()
Subclasses may override thisboolean
declaresFields()
Subclasses may override thisboolean
declaresTables()
Subclasses may override thisboolean
declaresWindows()
Subclasses may override thisboolean
equals(Object that)
Check whether thisQueryPart
can be considered equal to anotherQueryPart
.Field<?>
field(int index)
Get a specific field from this UDT.Field<?>
field(String string)
Get a specific field from this UDT.<T> Field<T>
field(Field<T> field)
Get a specific field from this UDT.Field<?>
field(Name fieldName)
Get a specific field from this UDT.Field<?>[]
fields()
Get all fields from this UDT.Field<?>[]
fields(int... fieldIndexes)
Get all fields from this UDT, providing some field indexes.Field<?>[]
fields(String... fieldNames)
Get all fields from this UDT, providing some field names.Field<?>[]
fields(Field<?>... f)
Get all fields from this UDT, providing some fields.Field<?>[]
fields(Name... fieldNames)
Get all fields from this UDT, providing some field names.Row
fieldsRow()
Get this UDT's fields as aRow
.Stream<Field<?>>
fieldStream()
Get this table's fields as aStream
.boolean
generatesCast()
Subclasses may override thisCatalog
getCatalog()
Get the object's catalog.String
getComment()
The comment on this object.Comment
getCommentPart()
The comment on this object as aQueryPart
.DataType<R>
getDataType()
The UDT's data type as known to the database.String
getName()
The unqualified name of this object.Package
getPackage()
Get the UDT package.Name
getQualifiedName()
The qualified name of this object.Class<R>
getRecordType()
Subclasses must override this method if they use the generic type parameterfor other types than Record
Schema
getSchema()
Get the object's schema.Name
getUnqualifiedName()
The unqualified name of this object.int
hashCode()
Generate a hash code from thisQueryPart
.int
indexOf(String fieldName)
Get a field's index from this udt.int
indexOf(Field<?> field)
Get a field's index from this udt.int
indexOf(Name fieldName)
Get a field's index from this udt.boolean
isSQLUsable()
Whether this data type can be used from SQL statements.boolean
isSynthetic()
Whether this data type is a synthetic, structural UDT type.R
newRecord()
Create a newRecord
of this UDT's type.boolean
rendersContent(Context<?> ctx)
Subclasses may override thisvoid
toSQL(RenderContext context)
Deprecated.- 3.4.0 - [#2694] - UseQueryPartInternal.accept(Context)
instead.String
toString()
Render a SQL string representation of thisQueryPart
.protected DataAccessException
translate(String sql, SQLException e)
Internal convenience method-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jooq.Named
getComment, getCommentPart, getName, getUnqualifiedName
-
-
-
-
Method Detail
-
getCatalog
public final Catalog getCatalog()
Description copied from interface:Qualified
Get the object's catalog.- Specified by:
getCatalog
in interfaceQualified
-
getSchema
public Schema getSchema()
Description copied from interface:Qualified
Get the object's schema.
-
getQualifiedName
public Name getQualifiedName()
Description copied from interface:Named
The qualified name of this object.- Specified by:
getQualifiedName
in interfaceNamed
-
getPackage
public final Package getPackage()
Description copied from interface:UDT
Get the UDT package.- Specified by:
getPackage
in interfaceUDT<R extends UDTRecord<R>>
-
fieldsRow
public final Row fieldsRow()
Description copied from interface:UDT
Get this UDT's fields as aRow
.
-
fieldStream
public final Stream<Field<?>> fieldStream()
Description copied from interface:UDT
Get this table's fields as aStream
.- Specified by:
fieldStream
in interfaceUDT<R extends UDTRecord<R>>
-
field
public final <T> Field<T> field(Field<T> field)
Description copied from interface:UDT
Get a specific field from this UDT.This will return:
- A field that is the same as the argument field (by identity comparison).
- A field that is equal to the argument field (exact matching fully qualified name).
- A field that is equal to the argument field (partially matching qualified name).
- A field whose name is equal to the name of the argument field.
null
otherwise.
-
field
public final Field<?> field(String string)
Description copied from interface:UDT
Get a specific field from this UDT.
-
field
public final Field<?> field(Name fieldName)
Description copied from interface:UDT
Get a specific field from this UDT.
-
field
public final Field<?> field(int index)
Description copied from interface:UDT
Get a specific field from this UDT.
-
fields
public final Field<?>[] fields()
Description copied from interface:UDT
Get all fields from this UDT.
-
fields
public final Field<?>[] fields(Field<?>... f)
Description copied from interface:UDT
Get all fields from this UDT, providing some fields.
-
fields
public final Field<?>[] fields(String... fieldNames)
Description copied from interface:UDT
Get all fields from this UDT, providing some field names.
-
fields
public final Field<?>[] fields(Name... fieldNames)
Description copied from interface:UDT
Get all fields from this UDT, providing some field names.
-
fields
public final Field<?>[] fields(int... fieldIndexes)
Description copied from interface:UDT
Get all fields from this UDT, providing some field indexes.
-
indexOf
public final int indexOf(Field<?> field)
Description copied from interface:UDT
Get a field's index from this udt.
-
indexOf
public final int indexOf(String fieldName)
Description copied from interface:UDT
Get a field's index from this udt.
-
indexOf
public final int indexOf(Name fieldName)
Description copied from interface:UDT
Get a field's index from this udt.
-
getRecordType
public Class<R> getRecordType()
Subclasses must override this method if they use the generic type parameterfor other types than Record
- Specified by:
getRecordType
in interfaceUDT<R extends UDTRecord<R>>
- Returns:
- The record type produced by this table.
-
isSQLUsable
public final boolean isSQLUsable()
Description copied from interface:UDT
Whether this data type can be used from SQL statements.- Specified by:
isSQLUsable
in interfaceUDT<R extends UDTRecord<R>>
-
isSynthetic
public final boolean isSynthetic()
Description copied from interface:UDT
Whether this data type is a synthetic, structural UDT type.This is
true
for example:- For Oracle
TAB%ROWTYPE
references, which are synthetic PL/SQL RECORD types in PL/SQL.
- Specified by:
isSynthetic
in interfaceUDT<R extends UDTRecord<R>>
- For Oracle
-
newRecord
public final R newRecord()
Description copied from interface:UDT
Create a newRecord
of this UDT's type.
-
getDataType
public final DataType<R> getDataType()
Description copied from interface:UDT
The UDT's data type as known to the database.- Specified by:
getDataType
in interfaceUDT<R extends UDTRecord<R>>
-
accept
public final void accept(Context<?> ctx)
Description copied from interface:QueryPartInternal
ThisQueryPart
canaccept
aContext
object in order to render a SQL string or to bind its variables.- Specified by:
accept
in interfaceQueryPartInternal
-
createField
@Deprecated protected static final <R extends UDTRecord<R>,T> UDTField<R,T> createField(String name, DataType<T> type, UDT<R> udt)
Deprecated.- 3.12.0 - [#8000] - UsecreateField(Name, DataType, UDT)
instead.Subclasses may call this method to createUDTField
objects that are linked to this table.- Parameters:
name
- The name of the field (case-sensitive!)type
- The data type of the field
-
createField
@Deprecated protected static final <R extends UDTRecord<R>,T> UDTField<R,T> createField(String name, DataType<T> type, UDT<R> udt, String comment)
Deprecated.- 3.12.0 - [#8000] - UsecreateField(Name, DataType, UDT, String)
instead.Subclasses may call this method to createUDTField
objects that are linked to this table.- Parameters:
name
- The name of the field (case-sensitive!)type
- The data type of the field
-
createField
@Deprecated protected static final <R extends UDTRecord<R>,T,U> UDTField<R,U> createField(String name, DataType<T> type, UDT<R> udt, String comment, Converter<T,U> converter)
Deprecated.- 3.12.0 - [#8000] - UsecreateField(Name, DataType, UDT, String, Converter)
instead.Subclasses may call this method to createUDTField
objects that are linked to this table.- Parameters:
name
- The name of the field (case-sensitive!)type
- The data type of the field
-
createField
@Deprecated protected static final <R extends UDTRecord<R>,T,U> UDTField<R,U> createField(String name, DataType<T> type, UDT<R> udt, String comment, Binding<T,U> binding)
Deprecated.- 3.12.0 - [#8000] - UsecreateField(Name, DataType, UDT, String, Binding)
instead.Subclasses may call this method to createUDTField
objects that are linked to this table.- Parameters:
name
- The name of the field (case-sensitive!)type
- The data type of the field
-
createField
@Deprecated protected static final <R extends UDTRecord<R>,T,X,U> UDTField<R,U> createField(String name, DataType<T> type, UDT<R> udt, String comment, Converter<X,U> converter, Binding<T,X> binding)
Deprecated.- 3.12.0 - [#8000] - UsecreateField(Name, DataType, UDT, String, Converter, Binding)
instead.Subclasses may call this method to createUDTField
objects that are linked to this table.- Parameters:
name
- The name of the field (case-sensitive!)type
- The data type of the field
-
createField
protected static final <R extends UDTRecord<R>,T> UDTField<R,T> createField(Name name, DataType<T> type, UDT<R> udt)
Subclasses may call this method to createUDTField
objects that are linked to this table.- Parameters:
name
- The name of the field (case-sensitive!)type
- The data type of the field
-
createField
protected static final <R extends UDTRecord<R>,T> UDTField<R,T> createField(Name name, DataType<T> type, UDT<R> udt, String comment)
Subclasses may call this method to createUDTField
objects that are linked to this table.- Parameters:
name
- The name of the field (case-sensitive!)type
- The data type of the field
-
createField
protected static final <R extends UDTRecord<R>,T,U> UDTField<R,U> createField(Name name, DataType<T> type, UDT<R> udt, String comment, Converter<T,U> converter)
Subclasses may call this method to createUDTField
objects that are linked to this table.- Parameters:
name
- The name of the field (case-sensitive!)type
- The data type of the field
-
createField
protected static final <R extends UDTRecord<R>,T,U> UDTField<R,U> createField(Name name, DataType<T> type, UDT<R> udt, String comment, Binding<T,U> binding)
Subclasses may call this method to createUDTField
objects that are linked to this table.- Parameters:
name
- The name of the field (case-sensitive!)type
- The data type of the field
-
createField
protected static final <R extends UDTRecord<R>,T,X,U> UDTField<R,U> createField(Name name, DataType<T> type, UDT<R> udt, String comment, Converter<X,U> converter, Binding<T,X> binding)
Subclasses may call this method to createUDTField
objects that are linked to this table.- Parameters:
name
- The name of the field (case-sensitive!)type
- The data type of the field
-
getName
public final String getName()
Description copied from interface:Named
The unqualified name of this object.
-
getUnqualifiedName
public final Name getUnqualifiedName()
Description copied from interface:Named
The unqualified name of this object.- Specified by:
getUnqualifiedName
in interfaceNamed
-
getComment
public final String getComment()
Description copied from interface:Named
The comment on this object.This is the same as calling
Named.getCommentPart()
and thenComment.getComment()
.- Specified by:
getComment
in interfaceNamed
-
getCommentPart
public final Comment getCommentPart()
Description copied from interface:Named
The comment on this object as aQueryPart
.- Specified by:
getCommentPart
in interfaceNamed
-
hashCode
public int hashCode()
Description copied from interface:QueryPart
Generate a hash code from thisQueryPart
.In general,
QueryPart
hash codes are the same as the hash codes generated fromQueryPart.toString()
. This guarantees consistent behaviour withQueryPart.equals(Object)
Some
QueryPart
implementations may choose to override this behaviour for improved performance, asQueryPart.toString()
is an expensive operation, if called many times.
-
equals
public boolean equals(Object that)
Description copied from interface:QueryPart
Check whether thisQueryPart
can be considered equal to anotherQueryPart
.In general,
QueryPart
equality is defined in terms ofQueryPart.toString()
equality. In other words, two query parts are considered equal if their rendered SQL (with inlined bind variables) is equal. This means that the two query parts do not necessarily have to be of the same type.Some
QueryPart
implementations may choose to override this behaviour for improved performance, asQueryPart.toString()
is an expensive operation, if called many times.
-
toSQL
@Deprecated public final void toSQL(RenderContext context)
Deprecated.- 3.4.0 - [#2694] - UseQueryPartInternal.accept(Context)
instead.Description copied from interface:QueryPartInternal
Render thisQueryPart
to a SQL string contained incontext.sql()
. Thecontext
will contain additional information about how to render thisQueryPart
, e.g. whether thisQueryPart
should be rendered as a declaration or reference, whether thisQueryPart
's contained bind variables should be inlined or replaced by'?'
, etc.- Specified by:
toSQL
in interfaceQueryPartInternal
-
bind
@Deprecated public final void bind(BindContext context) throws DataAccessException
Deprecated.- 3.4.0 - [#2694] - UseQueryPartInternal.accept(Context)
instead.Description copied from interface:QueryPartInternal
Bind all parameters of thisQueryPart
to a PreparedStatementThis method is for JOOQ INTERNAL USE only. Do not reference directly
- Specified by:
bind
in interfaceQueryPartInternal
- Parameters:
context
- The context holding the next bind index and other information for variable binding- Throws:
DataAccessException
- If something went wrong while binding a variable
-
clauses
@Deprecated public Clause[] clauses(Context<?> ctx)
Deprecated.- 3.11.0 - [#8179] - This functionality will be removed in the future.Description copied from interface:QueryPartInternal
TheClause
s that are represented by this query part.QueryPart
s can specify severalClause
s for which an event will be emittedbefore
(in forward order) andafter
(in reverse order) visiting the the query part throughContext.visit(QueryPart)
This method is for JOOQ INTERNAL USE only. Do not reference directly
- Specified by:
clauses
in interfaceQueryPartInternal
- Returns:
- The
Clause
s represented by this query part ornull
or an empty array if this query part does not represent a clause.
-
rendersContent
public boolean rendersContent(Context<?> ctx)
Subclasses may override this- Specified by:
rendersContent
in interfaceQueryPartInternal
-
declaresFields
public boolean declaresFields()
Subclasses may override this- Specified by:
declaresFields
in interfaceQueryPartInternal
-
declaresTables
public boolean declaresTables()
Subclasses may override this- Specified by:
declaresTables
in interfaceQueryPartInternal
-
declaresWindows
public boolean declaresWindows()
Subclasses may override this- Specified by:
declaresWindows
in interfaceQueryPartInternal
-
declaresCTE
public boolean declaresCTE()
Subclasses may override this- Specified by:
declaresCTE
in interfaceQueryPartInternal
-
generatesCast
public boolean generatesCast()
Subclasses may override this- Specified by:
generatesCast
in interfaceQueryPartInternal
-
toString
public String toString()
Description copied from interface:QueryPart
Render a SQL string representation of thisQueryPart
.For improved debugging, this renders a SQL string of this
QueryPart
with inlined bind variables. If thisQueryPart
isAttachable
, then the attachedConfiguration
may be used for rendering the SQL string, includingSQLDialect
andSettings
. Do note that mostQueryPart
instances are not attached to aConfiguration
, and thus there is no guarantee that the SQL string will make sense in the context of a specific database.
-
create
@Deprecated protected final DSLContext create()
Deprecated.- 3.11.0 - [#6722] - UseAttachable.configuration()
andConfiguration.dsl()
instead.Internal convenience method
-
create
@Deprecated protected final DSLContext create(Configuration configuration)
Deprecated.- 3.11.0 - [#6722] - UseAttachable.configuration()
andConfiguration.dsl()
instead.Internal convenience method
-
create
@Deprecated protected final DSLContext create(Context<?> ctx)
Deprecated.- 3.11.0 - [#6722] - UseAttachable.configuration()
andConfiguration.dsl()
instead.Internal convenience method
-
translate
protected final DataAccessException translate(String sql, SQLException e)
Internal convenience method
-
-