Uploaded image for project: 'Torque'
  1. Torque
  2. TORQUE-55

Generated OM compilation fails when table has 2 foreign keys to another table (and generateBeans=true)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.2
    • 3.3
    • Generator
    • None
    • JDK 1.5, Torque 3.2

    Description

      Given the following object model in a project where generateBeans=true

      BOOK
      -------------------------
      book_id : int
      author_id : int (FK)
      coauthor_id : int (FK)

      AUTHOR
      ------------------------
      author_id : int
      name : varchar(255)

      Compilation of the generated code fails with error messages shown below

      C:\Documents and Settings\Declan\bookstore\src\java\com\kazmier\om\BaseAuthor.java:1123: cannot find symbol
      symbol : method addBookFromBean(com.kazmier.om.Book)
      location: class com.kazmier.om.Author
      result.addBookFromBean(related);
      ^
      C:\Documents and Settings\Declan\bookstore\src\java\com\kazmier\om\BaseAuthor.java:1137: cannot find symbol
      symbol : method addBookFromBean(com.kazmier.om.Book)
      location: class com.kazmier.om.Author
      result.addBookFromBean(related);

      The solution is to change lines 1123 & 1137 from

      result.addBookFromBean(related);
      result.addBookFromBean(related);

      to

      result.addBookRelatedByAuthorIdFromBean(related);
      result.addBookRelatedByCoAuthorIdFromBean(related);

      Attachments

        1. project-schema.xml
          2 kB
          Declan Shanaghy

        Activity

          People

            Unassigned Unassigned
            declanshanaghy Declan Shanaghy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: