[OS-JIRA] Created: (CAY-194) Error in generating SQL query in modeling parent child relathionship

From: jir..bjectstyle.org
Date: Tue Sep 21 2004 - 12:38:46 EDT

  • Next message: Andrus Adamchik: "Modeler Preferences"

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-194

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-194
        Summary: Error in generating SQL query in modeling parent child relathionship
           Type: Bug

         Status: Assigned
       Priority: Major

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Versions:
                 1.1 [BETA]

       Assignee: Andrus Adamchik
       Reporter: Adrian Popa

        Created: Tue, 21 Sep 2004 12:37 PM
        Updated: Tue, 21 Sep 2004 12:37 PM
    Environment: Windows XP java 1.4

    Description:
    I have a table "content" with 2 fields: "id" and "parent_id". "id" is the primary key for the table. I defined a db relationship from "parent_id" to "id" named "toParent". On the content entity I defined a relationship parentContent using the db relationship toParent. When I call getParentContent the generated sql query displayed in the log is something like that:

    SELECT DISTINCT t0.ID, t0.PARENT_CONTENT_ID FROM CONTENT t0, CONTENT t1 WHERE t0.ID = t1.PARENT_CONTENT_ID AND ((t0.ID = ?)

    but what I would expect would be:

    SELECT DISTINCT t0.ID, t0.PARENT_CONTENT_ID FROM CONTENT t0, CONTENT t1 WHERE t0.ID = t1.PARENT_CONTENT_ID AND ((t1.ID = ?)

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Tue Sep 21 2004 - 12:38:48 EDT