Grails
  1. Grails
  2. GRAILS-6460

support for collections of composite value types

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.2
    • Fix Version/s: None
    • Component/s: Persistence
    • Labels:
      None
    • Environment:
      OpenJDK 6, Debian Linux
    • Testcase included:
      yes

      Description

      GORM does not appear to support collections of composite value types, which is supported in Hibernate.

      Sample domain class Person, with a value-type Address:

      class Person {
          static hasMany = [addresses: Address]
      }
      class Address {
          String number
          String code
      }
      

      This gives an exception at startup:

      org.hibernate.MappingException: Type [null] is not a basic type or a domain class and cannot be mapped. Either specify a type
      within the [mapping] block or use a basic type (String, Integer etc.)
              at
      org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindCollectionWithJoinTable(GrailsDomainBinder.java:618)
              at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindCollectionSecondPass(GrailsDomainBinder.java:527)
              at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.access$100(GrailsDomainBinder.java:75)
      

      Adding a static "embedded" property for the collection does not help. I suggest that the use of embedded properties be extended to collections like this.

        Activity

        Hide
        Rob Hruska added a comment -

        Also observed in version 1.3.7. I tried creating a custom UserType implementation and defining it with "grails.gorm.default.mapping" for the mapped type, but that didn't help either.

        Show
        Rob Hruska added a comment - Also observed in version 1.3.7. I tried creating a custom UserType implementation and defining it with "grails.gorm.default.mapping" for the mapped type, but that didn't help either.

          People

          • Assignee:
            Unassigned
            Reporter:
            Marcus Better
          • Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development