- 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 TypeMethodDescriptionstatic JoinTypecross()The default cross join type.default booleanWhether the join type will be accompanied by an ON clause.static JoinTypeinner()The default inner join type.default booleanisOuter()Whether the join type is an outer join.static JoinTypeleft()The default left join type.static JoinTyperight()The default right join type.sql()The SQL representation of the join type.
-
Method Details
-
inner
The default inner join type. -
cross
The default cross join type. -
left
The default left join type. -
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
JoinTypeimplementation 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:
trueif the join type will be accompanied by an ON clause,falseotherwise.
-
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:
trueif the join type is an outer join,falseotherwise.
-