Results 1 to 2 of 2

Thread: Custom Validator constraint

  1. #1
    Join Date
    Feb 2012
    Posts
    11

    Default 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

  2. #2
    Join Date
    Feb 2012
    Posts
    11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •