History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-1788
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Graeme Rocher
Reporter: Bruce Cota
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Grails

Including a Foreign Key in a composite id causes a HibernateMappingException

Created: 05/Nov/07 02:02 PM   Updated: 19/Nov/07 10:15 AM
Component/s: Persistence
Affects Version/s: 1.0-RC1
Fix Version/s: 1.0-RC2

Time Tracking:
Not Specified

File Attachments: 1. File Center.groovy (0.2 kb)
2. File Left.groovy (0.1 kb)
3. Text File svn-diff.txt (2 kb)


Testcase included: yes
Patch Submitted: Yes


 Description  « Hide
When including a foreign key in a composite id, grails (rc1)
throws a org.hibernate.MappingException from
org.codehaus.groovy.grails.orm cfg.GrailsDomainBinder.java
line 531:
Iterator mappedByColumns = associatedClass.getProperty(otherSide.getName() ).getValue().getColumnIterator();

because, I gather, the properties inside the composite id aren't returned
by org.hibernate.mapping.PersistentClass.getProperty().

I addressed this by editing GrailsDomainBinder.java to catch the MappingException and check for a composite id.

Attached are two domain classes that cause exception to be thrown when the grails application is started.

Also attached is the svn diff of my changes to GrailsDomainBinder.java . I hope it helps.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.