Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-194

Error in generating SQL query in modeling parent child relathionship

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1 [LEGACY]
    • 1.1 [LEGACY]
    • Core Library
    • None
    • 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 = ?)

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            cayenne_adrianp Adrian Popa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: