Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.1
-
Fix Version/s: 2.0.4
-
Component/s: Persistence, Testing
-
Labels:None
-
Testcase included:yes
Description
Saving an entity with null for a property, then updating the property to a not-null value still retains the null value in the property index. The below test fails because it still finds the author with a null pseudonym.
def 'Null is de-indexed'() {
def author = new AuthorWithPseudonym(name: 'Samuel Clemens').save(failOnError: true)
author.pseudonym = 'Mark Twain'
author.save(failOnError: true)
expect:
!AuthorWithPseudonym.findByPseudonymIsNull()
}
Included fix for this in pull request
https://github.com/SpringSource/grails-data-mapping/pull/43