GORM JPA Plugin

Gorm-jpa constraints with app-engine don't work

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Blocker 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.

Activity

Hide
justin friedl added a comment -

Forgot to mention it was with grails 1.1.1

Show
justin friedl added a comment - Forgot to mention it was with grails 1.1.1

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated: