Created
August 21, 2013 14:39
-
-
Save sergiomichels/6295343 to your computer and use it in GitHub Desktop.
Inspect Grails Domain Class constraints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Test { | |
| String name | |
| Integer age | |
| BigDecimal salary | |
| static constraints = { | |
| name blank: false, maxSize: 60 | |
| age min: 18, max: 999 | |
| salary blank: false | |
| } | |
| } | |
| //use it directly | |
| println Test.constraints //Map | |
| //get constraints for age directly | |
| println Test.constraints.age | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment