Torque
  1. Torque
  2. TORQUE-187

Allow joins with subselects in the FROM clause

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0-beta1
    • Fix Version/s: 4.0-beta1
    • Component/s: Runtime
    • Labels:
      None

      Description

      It shall be possible to execute statements like

      SELECT * FROM table1, (SELECT * FROM table2 WHERE xxx) t2 WHERE table1.id = t2.id

      (I know this example can be rewritten as a simple join, the actual use case is more complicated)

      In the case of the Criteria object, this would suggest a call sequence like

      criteria.addAlias("t2", subCriteria);
      criteria.addJoin("t2.id", Table1Peer.ID);

        Activity

        Thomas Vandahl created issue -
        Thomas Vandahl made changes -
        Field Original Value New Value
        Description It shall be possible to execute statements like

        {code:sql}
        SELECT * FROM table1, (SELECT * FROM table2 WHERE xxx) t2 WHERE table1.id = t2.id
        {code}

        (I know this example can be rewritten as a simple join, the actual use case is more complicated)

        In the case of the Criteria object, this would suggest a call sequence like

        {code}
        criteria.addAlias("t2", subCriteria);
        criteria.addJoin("t2.id", Table1Peer.ID);
        {code}

        It shall be possible to execute statements like

        SELECT * FROM table1, (SELECT * FROM table2 WHERE xxx) t2 WHERE table1.id = t2.id

        (I know this example can be rewritten as a simple join, the actual use case is more complicated)

        In the case of the Criteria object, this would suggest a call sequence like

        criteria.addAlias("t2", subCriteria);
        criteria.addJoin("t2.id", Table1Peer.ID);

        Hide
        Thomas Fox added a comment -

        see org.apache.torque.generated.peer.JoinTest.testImplicitInnerJoinWithSubselect() in the test project for a test case

        Show
        Thomas Fox added a comment - see org.apache.torque.generated.peer.JoinTest.testImplicitInnerJoinWithSubselect() in the test project for a test case
        Thomas Fox made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Thomas Fox [ tfischer ]
        Fix Version/s 4.0 [ 12312102 ]
        Resolution Fixed [ 1 ]
        Thomas Fox made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        44d 13h 44m 1 Thomas Fox 27/Apr/12 03:32
        Resolved Resolved Closed Closed
        150d 4h 34m 1 Thomas Fox 24/Sep/12 08:06

          People

          • Assignee:
            Thomas Fox
            Reporter:
            Thomas Vandahl
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development