Class SQLJoin

java.lang.Object
no.sikt.graphitron.definitions.sql.SQLJoin
Direct Known Subclasses:
SQLJoinStatement

public class SQLJoin extends Object
Contains information on how to format join operations, including what type of join to use and which columns should be compared. This class contains only information on the join source, and needs to be provided the target table in order to produce a full join statement.

This class is intended as a temporary stage before the final target table and aliases are determined, as these may depend on additional graph paths that must be evaluated first, and can not be directly inferred from a single field and its directives.

  • Constructor Details

    • SQLJoin

      public SQLJoin(JoinListSequence joinSequence, List<SQLJoinField> joinFields, boolean nullable)
      Parameters:
      joinSequence - The "left" side of a join statement. This is the table to be joined from.
      joinFields - List of any conditions for the join operation.
      nullable - What kind of join operation is to be used.
  • Method Details

    • getJoinFields

      public List<SQLJoinField> getJoinFields()
      Returns:
      List of column or key comparisons used to construct the join statement.
    • getJoinType

      public SQLJoinType getJoinType()
      Returns:
      What kind of join operation is to be used.
    • getJoinSequence

      public JoinListSequence getJoinSequence()
      Returns:
      Source table to join from. The "left" side of a join statement.
    • toJoinString

      public no.sikt.graphitron.javapoet.CodeBlock toJoinString(String aliasName)
      Parameters:
      aliasName - The name of the table alias to be used for this particular join statement.
      Returns:
      A string that contains a complete join statement followed by all conditions set for this join.