Grails
  1. Grails
  2. GRAILS-5059

Null Pointer Exception when using SortedSet in ManytoMany relationship

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.1
    • Fix Version/s: None
    • Component/s: Persistence
    • Labels:
      None
    • Environment:
      GNU/Linux Debian, JDK 1.6, Netbeans 6.7

      Description

      Two classes, Libro (Book in Spanish) and Autor (Author) with many to many relationship, where Libro belongsTo Author. Want to sort both sides of the relationship according to Comparable implementation in both classes, so declared as SortedSet the hasMany lists as stated in the grails guide.

      When adding a second instance (first instance gets added ok), a Null Pointer Exception arise.

      I'm including an app with the two classes, and bootstrapped with a couple of instances of each.
      To reproduce, Add a new Autor, selecting at least one Book (Libro).

      If the SortedSet is switched back to Set, everything works as expected.

      I tried to make a Test (is inside the tar.gz), but couldn't make it to reflect the error :S. The thing that more puzzles me is that the bootstrap code works, but in the app doesn't.

      Tried to workaround with the static mapping

      {sort : " "}

      , but crashed too (i saw that there is already a JIRA about it)

      Thanks in advance for your efforts.

      1. StackTrace
        7 kB
        Luis Daniel Ibáñez
      2. tutoGrails.tar.gz
        210 kB
        Luis Daniel Ibáñez

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Luis Daniel Ibáñez
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development