Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Won't Fix
-
Affects Version/s: 1.0.2
-
Fix Version/s: 1.0.2
-
Component/s: Persistence
-
Labels:None
-
Testcase included:yes
Description
To reproduce the problem:
grails test-app
on the attached bug report.
The first test will fail and the second will be ok.
Uncomment the setter method in domain class Folder and both tests will pass.
Nabble forum reference: http://www.nabble.com/Strange-behavior-on-bidirectional-one-to-one-relations-to16011577.html
Attachments
-
$i18n.getText("admin.common.words.hide")
- onetoone-bug-report-14032008.zip
- 14/Mar/08 5:57 AM
- 42 kB
- Stefano Gualdi
-
- grails-app/conf/BootStrap.groovy 0.1 kB
- grails-app/conf/Config.groovy 3 kB
- grails-app/conf/DataSource.groovy 0.7 kB
- grails-app/conf/UrlMappings.groovy 0.2 kB
- grails-app/conf/spring/resources.groovy 0.0 kB
- grails-app/.../TestController.groovy 0.9 kB
- grails-app/domain/Folder.groovy 0.4 kB
- grails-app/domain/FolderSpec.groovy 0.1 kB
- grails-app/i18n/messages.properties 2 kB
- grails-app/i18n/messages_de.properties 3 kB
- grails-app/i18n/messages_es.properties 3 kB
- grails-app/i18n/messages_fr.properties 2 kB
- grails-app/i18n/messages_it.properties 2 kB
- grails-app/i18n/messages_ja.properties 2 kB
- grails-app/i18n/messages_nl.properties 3 kB
- grails-app/i18n/messages_ru.properties 4 kB
- grails-app/i18n/messages_th.properties 5 kB
- grails-app/.../messages_zh_CN.properties 2 kB
- grails-app/views/error.gsp 1 kB
- grails-app/views/layouts/main.gsp 0.7 kB
- grails-app/views/test/index.gsp 0.4 kB
- test/integration/FolderTests.groovy 0.7 kB
- test/.../TEST-FolderSpecsTests-err.txt 0.0 kB
- test/.../TEST-FolderSpecsTests-out.txt 0.0 kB
- test/reports/TEST-FolderSpecsTests.xml 0.4 kB
- test/reports/TEST-FolderTests-err.txt 0.1 kB
- test/reports/TEST-FolderTests-out.txt 0.1 kB
- test/reports/TEST-FolderTests.xml 20 kB
- test/.../TEST-TestControllerTests-err.txt 0.0 kB
- test/.../TEST-TestControllerTests-out.txt 0.0 kB
$i18n.getText("admin.common.words.show")- onetoone-bug-report-14032008.zip
- 14/Mar/08 5:57 AM
- 42 kB
- Stefano Gualdi
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
You have a bidirectional relationship, in this case you must make sure both sides of the relationship are associated. Changing the code in fillData to do:
folder.specification = spec spec.folder = folder <--- added this lineFixes the problem
folder.specification = spec spec.folder = folder <--- added this line