Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.3.2
-
Fix Version/s: 2.3-M2
-
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
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
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.