title: JOOQ, Unknown column 'ideas_service.parent_section.id' in 'on clause' when joining multiple tables
body: <p>So I have five tables I am trying to get back in one query</p>
  
  <pre><code>parent_section(id, gate_id)
  
  
  Assessment_Question(id,parent_section_id)
  
  
  Assessment_question_multi_choice_option(id, question_id)
  
  
  Assessment_answer_Group(id, entity_id)
  
  
  Assessment_Answer(id,assessment_question_id, assessment_answer_Group_id)
  </code></pre>
  
  <p>I am trying to list all questions</p>
  
  <p>Error is <code>Unknown column 'ideas_service.parent_section.id' in 'on clause'</code></p>
  
  <p>Here is my query </p>
  
  <pre><code>        dsl.select()
          .from(PARENT_SECTION,ASSESSMENT_ANSWER_GROUP)
          .join(ASSESSMENT_QUESTION)
          .on(PARENT_SECTION.ID.eq(ASSESSMENT_QUESTION.PARENT_SECTION_ID))
          .leftJoin(ASSESSMENT_QUESTION_MULTI_CHOICE_OPTION)
          .on(
              ASSESSMENT_QUESTION_MULTI_CHOICE_OPTION.ASSESSMENT_QUESTION_ID.eq(
                  ASSESSMENT_QUESTION.ID))
          .join(ASSESSMENT_ANSWER)
          .on(ASSESSMENT_ANSWER_GROUP.ID.eq(ASSESSMENT_ANSWER.ASSESSMENT_ANSWER_GROUP_ID))
          .where(PARENT_SECTION.GATE_ID.eq(gateId))
          .fetch()
  </code></pre>
  
  <p>Previously when I was only trying to query the table for three tables, parent_Section_assessment_question and assessment_question_multi_choice, my query was like this and it worked</p>
  
  <pre><code>    var queryResult =
      dsl.select()
          .from(PARENT_SECTION)
          .join(ASSESSMENT_QUESTION)
          .on(PARENT_SECTION.ID.eq(ASSESSMENT_QUESTION.PARENT_SECTION_ID))
          .leftJoin(ASSESSMENT_QUESTION_MULTI_CHOICE_OPTION)
          .on(
              ASSESSMENT_QUESTION_MULTI_CHOICE_OPTION.ASSESSMENT_QUESTION_ID.eq(
                  ASSESSMENT_QUESTION.ID))
          .where(PARENT_SECTION.GATE_ID.eq(gateId))
          .fetch()
  </code></pre>
  
  <p>How should I modify the working query to also list a join between a assessment_Answer_Group( where assessment_answer_Group.entity_id = x) on the questions assessment_answer.answer_group_id</p>
  
  <p>To clarify on the joining structure</p>
  
  <p>I am doing an inner join between parent_section and assessment_Question and a left join between assessment_question and assessment_multi_choice_option</p>
  
  <p>The join between answer_group and assessment_answer is separate from those three tables, it should be where assessment_answer_group.entity_id = x and join on assessment_Answer.answer_Group_id = assessment_answer_Grorup.id</p>
  
  <p>edit: After akinas comments my query is now this, it finds the assessment_answer_group but it does not find any assessment_answers</p>
  
  <pre><code>    var queryResult =
      dsl.select()
        //below line is cross join with an always true join coniditon
          .from(PARENT_SECTION.join(ASSESSMENT_ANSWER_GROUP).on(true))
          .join(ASSESSMENT_QUESTION)
          .on(PARENT_SECTION.ID.eq(ASSESSMENT_QUESTION.PARENT_SECTION_ID))
          .leftJoin(ASSESSMENT_QUESTION_MULTI_CHOICE_OPTION)
          .on(
              ASSESSMENT_QUESTION_MULTI_CHOICE_OPTION.ASSESSMENT_QUESTION_ID.eq(
                  ASSESSMENT_QUESTION.ID))
          .join(ASSESSMENT_ANSWER)
          .on(ASSESSMENT_ANSWER_GROUP.ID.eq(ASSESSMENT_ANSWER.ASSESSMENT_ANSWER_GROUP_ID))
          .where(PARENT_SECTION.GATE_ID.eq(gateId))
  </code></pre>