posted 14 years ago
So, I have a basic constraints for my domain class, that will allow a few fields to be nullable. But later in my app, for another use case, I will need them to be not nullable. Now I can't just set it to be not nullable, because the domain object is also used as my UserDetails object in Spring Security, and those fields need allow nulls at the time of registration.
Anyway, I created two sets of constraints and made a "submitValidation" closure that gets called to swap the constraints, then do a validate() call, but that doesn't seem to do the magic trick.
Does anyone have any other recommendations?
Thanks
Mark