title: grails: Duplicate rows inserted even after unique constraint
body: <p>I am able to insert multiple rows with same value actionName:"discard" and actionParameter:"". I want to avoid this scenario.</p>
  
  <p>Other constraints are working fine like i am not able to insert actionName:"rate-limit" and actionParameter:"5" twice.</p>
  
  <p>Here is my  domain class:</p>
  
  <p>class Exaaction {</p>
  
  <pre><code>String actionName
  String actionParameter
  
  static hasMany = [actionFlow:Flow]
  
  static constraints = {
      actionName(blank:false,nullable:false,inList:["discard","rate-limit","redirect"])
      actionParameter(blank:true,nullable:true,unique:'actionName',validator:{val,obj -&gt;
                      if(obj.actionName == 'discard' &amp;&amp; val != null){ return false}
                      else if(obj.actionName == 'rate-limit')
                      {
                          Utility util = new Utility()
                          if(!util.validateNum(val,0,2147483647))  {return false}
  
                      }
                      else if(obj.actionName == 'redirect')
                      {
                          if(val == null) {return false}
                          Utility util = new Utility()
                          if(!(util.validateIp(val) || util.validateIpAndPort(val) || util.validateASAndPort(val)) )  {return false}
                      }
      })
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Please let me know if there is an alternate way to do this?
  Thanks in advance!!</p>