You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "David Wisneski (JIRA)" <ji...@apache.org> on 2006/08/17 01:09:13 UTC

[jira] Created: (OPENJPA-18) bulk update to Entity with secondary table mapping produces BAD SQL

bulk update to Entity with secondary table mapping produces BAD SQL
-------------------------------------------------------------------

                 Key: OPENJPA-18
                 URL: http://issues.apache.org/jira/browse/OPENJPA-18
             Project: OpenJPA
          Issue Type: Bug
          Components: query
            Reporter: David Wisneski


EJBQL:   	update TwoTable t set  t.k1 = t.j2+1, t.j2= t.k1+1

TwoTable is mapped to primary and secondary table,  tj1, tj2 are fields in primary table,  tk1, tk2 are fields in secondary table.  

Generated SQL from the trace shows: 

DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703, SQLERRMC: J2 {prepstmnt 238685754 UPDATE ttk SET k1 = (j2 + ?), j2 = (k1 + ?) WHERE id IN (SELECT DISTINCT t0.id FROM ttk t0  INNER JOIN ttj t1 ON t0.id = t1.TwoTable_id) [params=(long) 1, (long) 1]} [code=-206, state=42703]


Note that  column j2 is not a column of take ttk which is the secondary table.  


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (OPENJPA-18) bulk update to Entity with secondary table mapping produces BAD SQL

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-18?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-18:
-----------------------------------

    Fix Version/s: 0.9.7

> bulk update to Entity with secondary table mapping produces BAD SQL
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-18
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-18
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>            Reporter: David Wisneski
>             Fix For: 0.9.7
>
>
> EJBQL:   	update TwoTable t set  t.k1 = t.j2+1, t.j2= t.k1+1
> TwoTable is mapped to primary and secondary table,  tj1, tj2 are fields in primary table,  tk1, tk2 are fields in secondary table.  
> Generated SQL from the trace shows: 
> DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703, SQLERRMC: J2 {prepstmnt 238685754 UPDATE ttk SET k1 = (j2 + ?), j2 = (k1 + ?) WHERE id IN (SELECT DISTINCT t0.id FROM ttk t0  INNER JOIN ttj t1 ON t0.id = t1.TwoTable_id) [params=(long) 1, (long) 1]} [code=-206, state=42703]
> Note that  column j2 is not a column of take ttk which is the secondary table.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.