Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-1366

DBRE generates incorrect 'mappedBy' name in 1-to-many

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.0.RC1
    • Fix Version/s: 1.1.0.RC1
    • Component/s: PERSISTENCE
    • Labels:
      None
    • Environment:
      Roo1.1.0M4 on Windows 7

      Description

      DBRE generates incorrect mappedBy. The bug seems to be in using foreign key/field sequence:

      Example:

      One the one-2-many side (Course):

      @OneToMany(mappedBy = "course")
      private Set<Student> Course.students;

      On the many-2-one side (Student):
      @ManyToOne
      @JoinColumn(name = "ST_CO", referencedColumnName = "CO_PK")
      private Course Student.course2;

      'mappedBy' should be 'course2' instead of 'course'; OR field 'Student.course2' should be 'Student.course' instead?

        Attachments

        1. Database.java
          6 kB
        2. dbre.xml
          5 kB
        3. jira1366.zip
          56 kB
        4. mysql_test_jira1366.sql
          2 kB

          Activity

            People

            Assignee:
            stewarta Alan Stewart
            Reporter:
            mduduzik Mduduzi Keswa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: