================================================================================
Query with SqlJoinType InnerJoin
================================================================================

query 134 "OCR Vendor Bank Accounts"
{
    Caption = 'OCR Vendor Bank Accounts';

    elements
    {
        dataitem(Vendor_Bank_Account; "Vendor Bank Account")
        {
            column(Code; Code)
            {
            }
            dataitem(Vendor; Vendor)
            {
                DataItemLink = "No." = Vendor_Bank_Account."Vendor No.";
                SqlJoinType = InnerJoin;
                column(Id; SystemId)
                {
                }
            }
        }
    }
}

--------------------------------------------------------------------------------

(source_file
  (query_declaration
    (query_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (property
      name: (property_name)
      value: (string_literal))
    (elements_section
      (elements_keyword)
      (query_dataitem
        (dataitem_keyword)
        name: (identifier)
        table_name: (quoted_identifier)
        (query_column
          (column_keyword)
          name: (identifier)
          field_name: (identifier))
        (query_dataitem
          (dataitem_keyword)
          name: (identifier)
          table_name: (identifier)
          (property
            name: (property_name)
            value: (property_expression
              (comparison_expression
                left: (quoted_identifier)
                operator: (comparison_operator)
                right: (member_expression
                  object: (identifier)
                  member: (quoted_identifier)))))
          (property
            name: (property_name)
            value: (identifier))
          (query_column
            (column_keyword)
            name: (identifier)
            field_name: (identifier)))))))

================================================================================
Query with SqlJoinType LeftOuterJoin
================================================================================

query 50001 "Customer Query"
{
    QueryType = Normal;
    
    elements
    {
        dataitem(Customer; Customer)
        {
            column(No; "No.")
            {
            }
            dataitem(Customer_Ledger_Entry; "Customer Ledger Entry")
            {
                DataItemLink = "Customer No." = Customer."No.";
                SqlJoinType = LeftOuterJoin;
                
                column(Amount; Amount)
                {
                }
            }
        }
    }
}

--------------------------------------------------------------------------------

(source_file
  (query_declaration
    (query_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (property
      name: (property_name)
      value: (identifier))
    (elements_section
      (elements_keyword)
      (query_dataitem
        (dataitem_keyword)
        name: (identifier)
        table_name: (identifier)
        (query_column
          (column_keyword)
          name: (identifier)
          field_name: (quoted_identifier))
        (query_dataitem
          (dataitem_keyword)
          name: (identifier)
          table_name: (quoted_identifier)
          (property
            name: (property_name)
            value: (property_expression
              (comparison_expression
                left: (quoted_identifier)
                operator: (comparison_operator)
                right: (member_expression
                  object: (identifier)
                  member: (quoted_identifier)))))
          (property
            name: (property_name)
            value: (identifier))
          (query_column
            (column_keyword)
            name: (identifier)
            field_name: (identifier)))))))

================================================================================
Query with SqlJoinType CrossJoin
================================================================================

query 50002 "Dimension Cross Join"
{
    elements
    {
        dataitem(DimensionSet; "Dimension Set")
        {
            column(DimSetID; ID)
            {
            }
            dataitem(DimensionValue; "Dimension Value")
            {
                SqlJoinType = CrossJoin;
                column(DimCode; "Dimension Code")
                {
                }
            }
        }
    }
}

--------------------------------------------------------------------------------

(source_file
  (query_declaration
    (query_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (elements_section
      (elements_keyword)
      (query_dataitem
        (dataitem_keyword)
        name: (identifier)
        table_name: (quoted_identifier)
        (query_column
          (column_keyword)
          name: (identifier)
          field_name: (identifier))
        (query_dataitem
          (dataitem_keyword)
          name: (identifier)
          table_name: (quoted_identifier)
          (property
            name: (property_name)
            value: (identifier))
          (query_column
            (column_keyword)
            name: (identifier)
            field_name: (quoted_identifier)))))))

================================================================================
Report dataitem with SqlJoinType
================================================================================

report 50003 "Sales Report"
{
    dataset
    {
        dataitem(Customer; Customer)
        {
            column(CustomerNo; "No.")
            {
            }
            dataitem(SalesHeader; "Sales Header")
            {
                DataItemLink = "Sell-to Customer No." = Customer."No.";
                SqlJoinType = InnerJoin;
                
                column(DocumentNo; "No.")
                {
                }
            }
        }
    }
}

--------------------------------------------------------------------------------

(source_file
  (report_declaration
    (report_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (dataset_section
      (dataset_keyword)
      (report_dataitem
        (dataitem_keyword)
        name: (identifier)
        table_name: (identifier)
        (report_column
          (column_keyword)
          name: (identifier)
          source: (quoted_identifier))
        (report_dataitem
          (dataitem_keyword)
          name: (identifier)
          table_name: (quoted_identifier)
          (property
            name: (property_name)
            value: (property_expression
              (comparison_expression
                left: (quoted_identifier)
                operator: (comparison_operator)
                right: (member_expression
                  object: (identifier)
                  member: (quoted_identifier)))))
          (property
            name: (property_name)
            value: (identifier))
          (report_column
            (column_keyword)
            name: (identifier)
            source: (quoted_identifier)))))))

================================================================================
Mixed case SqlJoinType property
================================================================================

query 50004 "Test Query"
{
    elements
    {
        dataitem(Table1; Table1)
        {
            dataitem(Table2; Table2)
            {
                sqljointype = innerjoin;
            }
            dataitem(Table3; Table3)
            {
                SQLJOINTYPE = LEFTOUTERJOIN;
            }
            dataitem(Table4; Table4)
            {
                SqlJoinType = CrossJoin;
            }
        }
    }
}

--------------------------------------------------------------------------------

(source_file
  (query_declaration
    (query_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (elements_section
      (elements_keyword)
      (query_dataitem
        (dataitem_keyword)
        name: (identifier)
        table_name: (identifier)
        (query_dataitem
          (dataitem_keyword)
          name: (identifier)
          table_name: (identifier)
          (property
            name: (property_name)
            value: (identifier)))
        (query_dataitem
          (dataitem_keyword)
          name: (identifier)
          table_name: (identifier)
          (property
            name: (property_name)
            value: (identifier)))
        (query_dataitem
          (dataitem_keyword)
          name: (identifier)
          table_name: (identifier)
          (property
            name: (property_name)
            value: (identifier)))))))
