Package st.orm

Interface JoinType

All Known Implementing Classes:
DefaultJoinType

public interface JoinType
Represents a join type in a SQL query.

There are four default join types that can be accessed via the static methods. Alternatively, custom join types can be created by implementing this interface.

  • Method Summary

    Modifier and Type
    Method
    Description
    static JoinType
    The default cross join type.
    default boolean
    Whether the join type will be accompanied by an ON clause.
    static JoinType
    The default inner join type.
    default boolean
    Whether the join type is an outer join.
    static JoinType
    The default left join type.
    static JoinType
    The default right join type.
    sql()
    The SQL representation of the join type.
  • Method Details

    • inner

      static JoinType inner()
      The default inner join type.
    • cross

      static JoinType cross()
      The default cross join type.
    • left

      static JoinType left()
      The default left join type.
    • right

      static JoinType right()
      The default right join type.
    • sql

      String sql()
      The SQL representation of the join type. For example, "INNER JOIN" or "LEFT JOIN".
      Returns:
      the SQL representation of the join type.
    • hasOnClause

      default boolean hasOnClause()
      Whether the join type will be accompanied by an ON clause.

      Note: The JoinType implementation is not responsible for generating the ON clause. This method is used to determine whether the ON clause should be included in the generated SQL.

      Returns:
      true if the join type will be accompanied by an ON clause, false otherwise.
    • isOuter

      default boolean isOuter()
      Whether the join type is an outer join.

      Outer joins will be treated differently when generating the SQL. Outer joins will be placed at the end of the join list to prevent undesired side effects.

      Returns:
      true if the join type is an outer join, false otherwise.