Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.1
-
Fix Version/s: 1.1-beta3
-
Component/s: Persistence
-
Labels:None
-
Environment:Windows XP
-
Testcase included:yes
Description
In GORM, `auto-import' seems to be false.
Moreover, the method of changing the value is necessary.
------------------- Model.groovy --------------------------- package com.p class Model { String name } ----------------------------------------------------------------- import com.p.Model class AutoImportTests extends GroovyTestCase { void testAutoImport() { def aModel = new Model(name:'Name') aModel.save(flush:true) def models = Model.findAll("from Model as m where m.name = 'Name'") // NG //def models = Model.findAll("from com.p.Model as m where m.name = 'Name'") // GOOD assertTrue models.size() == 1 } }
Having just been hit by this issue, I think it would make a good improvement. Basically, I think "auto-import" should default to "true" with the option of disabling it within a custom ORM mapping for individual domain classes.