db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Petr Bodnar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TORQUE-108) Criteria addJoin causes incorrect SQL to be generated when optional schema references are in use (Oracle)
Date Thu, 22 Oct 2015 18:52:27 GMT

    [ https://issues.apache.org/jira/browse/TORQUE-108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14969641#comment-14969641
] 

Petr Bodnar commented on TORQUE-108:
------------------------------------

Thanks, confirmed for 4.x trunk, the problematic scenario is not quite covered by a unit test,
so I needed to write my own one...

The second thing is this patch doesn't really affect the error with aliases, i. e. "<table>
<schema>.<alias>" is wrongly added to the from clause instead of "<schema>.<table>
<alias>" with or without the patch, *in 3.3*.

BTW It's a pity that one needs to wrap every single column or expression into ColumnImpl in
4.0, but that's for quite another ticket... :)

> Criteria addJoin causes incorrect SQL to be generated when optional schema references
are in use (Oracle)
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: TORQUE-108
>                 URL: https://issues.apache.org/jira/browse/TORQUE-108
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 3.3-RC1, 3.3-RC2, 3.3-RC3
>         Environment: Linux, Java 1.6
>            Reporter: Brendan Miller
>            Assignee: Thomas Fox
>             Fix For: 4.0-beta1
>
>         Attachments: JoinBuilderTest.java, joinbuilder.patch
>
>
> 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?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message