Module org.jooq
Package org.jooq

Interface QueryPart

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean equals​(Object object)
      Check whether this QueryPart can be considered equal to another QueryPart.
      int hashCode()
      Generate a hash code from this QueryPart.
      String toString()
      Render a SQL string representation of this QueryPart.
    • Method Detail

      • toString

        String toString()
        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.

        Overrides:
        toString in class Object
        Returns:
        A SQL string representation of this QueryPart
      • equals

        boolean equals​(Object object)
        Check whether this QueryPart can be considered equal to another QueryPart.

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

        Overrides:
        equals in class Object
        Parameters:
        object - The other QueryPart
        Returns:
        Whether the two query parts are equal
      • hashCode

        int hashCode()
        Generate a hash code from this QueryPart.

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

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

        Overrides:
        hashCode in class Object
        Returns:
        The QueryPart hash code