Announcement Announcement Module
Collapse
No announcement yet.
DBRE generates incorrect 'mappedBy' name in 1-to-many Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    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?

    Thanks.

  • #2
    Bug Fixed

    There's bug in Database.initialize(). setKeySequence() for both foreignKey and exportKey is calculated incorrectly.

    Let me know if there's an interest in the fix.

    Comment


    • #3
      Was "course2" generated by DBRE (that is, did it appear in the ITD) or did you add the mapping yourself in the .java file? Regardless, please log a bug in Jira and attach your fix. I will have a close look at the issue.

      Comment


      • #4
        Yes. It was generated by DBRE. Will file a JIRA.

        Comment


        • #5
          JIRA Filed

          https://jira.springframework.org/browse/ROO-1366

          Comment

          Working...
          X