Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.
Close

#37 duplicate correlation name

v2.0
closed-fixed
None
5
2005-09-01
2004-08-18
Jeff Brown
No

I believe that TJDO has a problem where under certain
circumstances it generates sql that is invalid because a
correlation name is used twice in the same statement.

q.declareVariables("CD cd1; CD cd2");
q.setFilter("(cdSet.contains(cd) && cd.title.
startsWith(\"E\")) && (cdSet.contains(cd2) && cd2.title.
startsWith(\"F\"))")

My intent is to retrieve Stores that have a cd title
beginning with E _AND_ a cd title that begins with F. If
that seems silly, in our domain context it really does make
sense (we aren't really dealing with CDs and Stores).

The error I get is something like this...

The correlation name 'THIS_CD_SET' is specified multiple
times in a FROM clause.
at com.triactive.jdo.store.DatabaseAdapter.
newDataStoreException(DatabaseAdapter.java:482)

I believe what has happened in the generated SQL is two
separate inner joins are created that try to use that
same correlation name.

Discussion

  • Mike Martin

    Mike Martin - 2005-09-01
    • assigned_to: nobody --> jackknifebarber
    • status: open --> closed-fixed
     
  • Mike Martin

    Mike Martin - 2005-09-01

    Logged In: YES
    user_id=582193

    Fixed in refactor of query statement generation, due for
    inclusion in 2.2 release.

     

Log in to post a comment.