Torque
  1. Torque
  2. TORQUE-108

Criteria addJoin causes incorrect SQL to be generated when optional schema references are in use (Oracle)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3-RC1, 3.3-RC2, 3.3-RC3
    • Fix Version/s: 4.0-beta1
    • Component/s: Runtime
    • Labels:
      None
    • Environment:
      Linux, Java 1.6

      Description

      I previously wrote about this to torque-user in Oct 2007.

      In a schema definition that includes torque.dsfactory.programs.schema, writing the following

      Criteria crit = new Criteria();
      crit.addJoin(TransactionPeer.ORDER_ID, OrderPeer.ID);
      crit.add(TransactionPeer.ACCT_ID, account.getID());
      List<Order> orders = OrderPeer.doSelect(crit);

      generates

      SELECT <..ORDERS columns..> FROM TRANSACTION, ORDERS, DBSCHEMA.ORDERS, DBSCHEMA.TRANSACTION
      WHERE TRANSACTION.ORDER_ID=ORDERS.ID AND TRANSACTION.ACCT_ID= ?

      Upon examining the Torque code, it appears that SQLBuilder.processJoins does not add the full table names, while SQLBuilder.processCriterions does.
      Shouldn't they both add the full table names?

      1. JoinBuilderTest.java
        3 kB
        Brendan Miller
      2. joinbuilder.patch
        2 kB
        Brendan Miller

        Activity

        Brendan Miller created issue -
        Brendan Miller made changes -
        Field Original Value New Value
        Attachment joinbuilder.patch [ 12374716 ]
        Brendan Miller made changes -
        Attachment JoinBuilderTest.java [ 12375008 ]
        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 ]

          People

          • Assignee:
            Thomas Fox
            Reporter:
            Brendan Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development