Module org.jooq
Package org.jooq.impl

Class UDTImpl<R extends UDTRecord<R>>

    • Method Detail

      • getQualifiedName

        public Name getQualifiedName()
        Description copied from interface: Named
        The qualified name of this object.
        Specified by:
        getQualifiedName in interface Named
      • getPackage

        public final Package getPackage()
        Description copied from interface: UDT
        Get the UDT package.
        Specified by:
        getPackage in interface UDT<R extends UDTRecord<R>>
      • fieldsRow

        public final Row fieldsRow()
        Description copied from interface: UDT
        Get this UDT's fields as a Row.
        Specified by:
        fieldsRow in interface UDT<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.
        If several fields have the same name, the first one is returned and a warning is logged.
        Specified by:
        field in interface UDT<R extends UDTRecord<R>>
        See Also:
        Row.field(Field)
      • field

        public final Field<?> field​(int index)
        Description copied from interface: UDT
        Get a specific field from this UDT.
        Specified by:
        field in interface UDT<R extends UDTRecord<R>>
        See Also:
        Row.field(int)
      • fields

        public final Field<?>[] fields()
        Description copied from interface: UDT
        Get all fields from this UDT.
        Specified by:
        fields in interface UDT<R extends UDTRecord<R>>
        See Also:
        Row.fields()
      • fields

        public final Field<?>[] fields​(Field<?>... f)
        Description copied from interface: UDT
        Get all fields from this UDT, providing some fields.
        Specified by:
        fields in interface UDT<R extends UDTRecord<R>>
        Returns:
        All available fields
        See Also:
        Row.fields(Field...)
      • fields

        public final Field<?>[] fields​(String... fieldNames)
        Description copied from interface: UDT
        Get all fields from this UDT, providing some field names.
        Specified by:
        fields in interface UDT<R extends UDTRecord<R>>
        Returns:
        All available fields
        See Also:
        Row.fields(String...)
      • fields

        public final Field<?>[] fields​(Name... fieldNames)
        Description copied from interface: UDT
        Get all fields from this UDT, providing some field names.
        Specified by:
        fields in interface UDT<R extends UDTRecord<R>>
        Returns:
        All available fields
        See Also:
        Row.fields(Name...)
      • fields

        public final Field<?>[] fields​(int... fieldIndexes)
        Description copied from interface: UDT
        Get all fields from this UDT, providing some field indexes.
        Specified by:
        fields in interface UDT<R extends UDTRecord<R>>
        Returns:
        All available fields
        See Also:
        Row.fields(int...)
      • indexOf

        public final int indexOf​(Field<?> field)
        Description copied from interface: UDT
        Get a field's index from this udt.
        Specified by:
        indexOf in interface UDT<R extends UDTRecord<R>>
        Parameters:
        field - The field to look for
        Returns:
        The field's index or -1 if the field is not contained in this udt.
      • indexOf

        public final int indexOf​(String fieldName)
        Description copied from interface: UDT
        Get a field's index from this udt.
        Specified by:
        indexOf in interface UDT<R extends UDTRecord<R>>
        Parameters:
        fieldName - The field name to look for
        Returns:
        The field's index or -1 if the field is not contained in this udt.
      • indexOf

        public final int indexOf​(Name fieldName)
        Description copied from interface: UDT
        Get a field's index from this udt.
        Specified by:
        indexOf in interface UDT<R extends UDTRecord<R>>
        Parameters:
        fieldName - The field name to look for
        Returns:
        The field's index or -1 if the field is not contained in this udt
      • getRecordType

        public Class<R> getRecordType()
        Subclasses must override this method if they use the generic type parameter for other types than Record
        Specified by:
        getRecordType in interface UDT<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 interface UDT<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 interface UDT<R extends UDTRecord<R>>
      • 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 interface UDT<R extends UDTRecord<R>>
      • 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 create UDTField 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 create UDTField 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 create UDTField 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 create UDTField 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 create UDTField 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.
        Specified by:
        getName in interface Named
      • getUnqualifiedName

        public final Name getUnqualifiedName()
        Description copied from interface: Named
        The unqualified name of this object.
        Specified by:
        getUnqualifiedName in interface Named
      • hashCode

        public int hashCode()
        Description copied from interface: QueryPart
        Generate a hash code from this QueryPart.

        In general, QueryPart hash codes are the same as the hash codes generated from QueryPart.toString(). This guarantees consistent behaviour with QueryPart.equals(Object)

        Some QueryPart implementations may choose to override this behaviour for improved performance, as QueryPart.toString() is an expensive operation, if called many times.

        Specified by:
        hashCode in interface QueryPart
        Returns:
        The QueryPart hash code
      • equals

        public boolean equals​(Object that)
        Description copied from interface: QueryPart
        Check whether this QueryPart can be considered equal to another QueryPart.

        In general, QueryPart equality is defined in terms of QueryPart.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, as QueryPart.toString() is an expensive operation, if called many times.

        Specified by:
        equals in interface QueryPart
        Parameters:
        that - The other QueryPart
        Returns:
        Whether the two query parts are equal
      • toSQL

        @Deprecated
        public final void toSQL​(RenderContext context)
        Deprecated.
        - 3.4.0 - [#2694] - Use QueryPartInternal.accept(Context) instead.
        Description copied from interface: QueryPartInternal
        Render this QueryPart to a SQL string contained in context.sql(). The context will contain additional information about how to render this QueryPart, e.g. whether this QueryPart should be rendered as a declaration or reference, whether this QueryPart's contained bind variables should be inlined or replaced by '?', etc.
        Specified by:
        toSQL in interface QueryPartInternal
      • 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
        The Clauses that are represented by this query part.

        QueryParts can specify several Clauses for which an event will be emitted before (in forward order) and after (in reverse order) visiting the the query part through Context.visit(QueryPart)

        This method is for JOOQ INTERNAL USE only. Do not reference directly

        Specified by:
        clauses in interface QueryPartInternal
        Returns:
        The Clauses represented by this query part or null or an empty array if this query part does not represent a clause.
      • toString

        public String toString()
        Description copied from interface: QueryPart
        Render a SQL string representation of this QueryPart.

        For improved debugging, this renders a SQL string of this QueryPart with inlined bind variables. If this QueryPart is Attachable, then the attached Configuration may be used for rendering the SQL string, including SQLDialect and Settings. Do note that most QueryPart instances are not attached to a Configuration, and thus there is no guarantee that the SQL string will make sense in the context of a specific database.

        Specified by:
        toString in interface QueryPart
        Overrides:
        toString in class Object
        Returns:
        A SQL string representation of this QueryPart