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

Flattened attribute queries are incorrectly generated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.1
    • 3.0.2, 3.1M1
    • Core Library
    • None
    • Gentoo linux
      MySQL 5.1
      java version "1.6.0_20"
      Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
      Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

    Description

      Attached eclipse project demonstrating issue, including cayenne model
      When creating database structure like:
      table1
      t1key
      t1value
      t2keyref
      table2
      t2key
      t2value
      t3keyref
      table3
      t3key
      t3value
      and cayenne model with flattened attribute table3.t3value in table2
      it produces incorrect join query to table2 and 3:
      SELECT t1.t3value, t1.t2key, t0.t2value, t0.t3keyref, t0.t2key FROM testschema.table2 t0 JOIN testschema.table3 t1 ON (t0.t3key = t1.t3keyref) WHERE t0.t2key = ?

      Note t1.t2key, which obviously shouldn't be there and produces error.

      Attachments

        1. bugdemo_maven_derby_nobug.zip
          22 kB
          Misha Doronin
        2. bugdemo_maven_derby.zip
          22 kB
          Misha Doronin
        3. CAY-1484.-Fixed-using-of-incorrect-alias.patch
          9 kB
          Ksenia Khailenko
        4. CayenneBugDemo.zip
          17 kB
          Misha Doronin

        Activity

          People

            Unassigned Unassigned
            misdoro Misha Doronin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified