-
Feb 7th, 2012, 11:16 AM
#1
Custom Validator constraint
Hi all,
I am trying to create some custom validation functionality. Please consider the following Domain Object
class MyObject {
String name
String email
static constraints {
// I want the email to be unique. my data is in AD
// MyObject would only be stored if there is no MyAdModel with same mail attribute
email(MyAdModel.findAll(filter: "(mail=$email)"))
}
}
Is this the best practice to go about it?
Note that I use Grails Ldap plugin to access AD.
Many thanks,
--G
-
Feb 8th, 2012, 11:18 AM
#2
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules