Grails
  1. Grails
  2. GRAILS-8314

Finders seem to be broken in some situations with polymorphic domain classes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-RC1
    • Fix Version/s: 2.0-RC2
    • Component/s: None
    • Labels:
      None

      Description

      With the Weceem plugin I have found that Grails 2rc1 gives incorrect results for:

      WcmContentFile.findAllBySpace(space)
      

      What happens is you get back all content nodes where x.space = space, not just WcmContentFile and descendent types.

      The graph is like this:

      WcmContent <---- WcmContentFile <---- WcmContentDirectory
                 <---- WcmFolder
                 <---- WcmHTMLContent etc.
      

      The above query should return only WcmContentFile and WcmContentDirectory but it returns all types.

      I tried to isolate this with different domain objects but could not. The only isolation I managed is to install weceem plugin into a fresh app and test a query at startup in BootStrap. This shows the failure in an app that uses weceem plugin.

      The attached bug-report app includes some test domain classes that attempt to mimic and isolate the ORM hierarchy that causes the problem but to no avail yet.

        Activity

        Show
        Graeme Rocher added a comment - Fixed by https://github.com/SpringSource/grails-data-mapping/commit/b0c8fb3e11945efb14f9410302f30fdfb53ac5d2

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Marc Palmer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development