Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Blocker
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:app-engine 0.8.5
gorm-jpa 0.5
-
Patch Submitted:Yes
Description
I created two domain classes and added constraints to each of them. "validate" fails on one of them as it's using the constraints from the other domain class.
Upon investigation in gorm-jpa plugin's JpaPluginSupport.groovy
I changed the lines:
getConstraints {->
domainClass.constrainedProperties
}
with:
def cp = domainClass.constrainedProperties
getConstraints {->
cp
}
the domainClass is somehow being switched after this is called and before the closure is executed. I'm not exactly sure how the domainClass can switch from domainClass A to domainClass B. I can't explain why the change I made works when the original does not, as both "domainClass" and "cp" appear to be in the same scope.
Forgot to mention it was with grails 1.1.1