Class SQLJoinStatement

java.lang.Object
no.sikt.graphitron.definitions.sql.SQLJoin
no.sikt.graphitron.definitions.sql.SQLJoinStatement

public class SQLJoinStatement extends SQLJoin
An extension of SQLJoin with additional data on which table to join towards and which alias should be used. This class then contains all the information necessary to construct a complete join statement.
  • Constructor Details

    • SQLJoinStatement

      public SQLJoinStatement(JoinListSequence joinSequence, JoinElement joinTargetTable, AliasWrapper joinAlias, List<SQLJoinField> joinFields, boolean nullable)
      Parameters:
      joinTargetTable - The "right" side of a join statement. This is the table to be joined with.
      joinFields - List of any conditions for the join operation.
      nullable - What kind of join operation is to be used.
    • SQLJoinStatement

      public SQLJoinStatement(JoinListSequence joinSequence, JoinElement joinTargetTable, AliasWrapper joinAlias, List<SQLJoinField> joinFields, boolean nullable, JOOQMapping key)
      Parameters:
      joinTargetTable - The "right" side of a join statement. This is the table to be joined with.
      joinFields - List of any conditions for the join operation.
      nullable - What kind of join operation is to be used.
      key - The foreign key used for this join, if available. Used to generate EXISTS subqueries for filter-only LEFT JOINs.
  • Method Details

    • getJoinSequence

      public JoinListSequence getJoinSequence()
      Overrides:
      getJoinSequence in class SQLJoin
      Returns:
      Source table to join from. The "left" side of a join statement.
    • getJoinTargetTable

      public JoinElement getJoinTargetTable()
      Returns:
      The target table to be joined with. The "right" side of a join statement.
    • getJoinAlias

      public AliasWrapper getJoinAlias()
      Returns:
      The alias to be used to uniquely distinguish this join operation.
    • getKey

      public JOOQMapping getKey()
      Returns:
      The foreign key used for this join, or null if not available.
    • toJoinString

      public no.sikt.graphitron.javapoet.CodeBlock toJoinString()
      Returns:
      A string that contains a complete join statement followed by all conditions set for this join.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object