Grails' GORM constraint question

Posted by xain on Stack Overflow See other posts from Stack Overflow or by xain
Published on 2010-06-04T19:33:12Z Indexed on 2010/06/07 1:52 UTC
Read the original article Hit count: 233

Filed under:
|
|

Hi, I have the following Domain Class:

 class Metric {

   String name
   float value

   static belongsTo = [Person,Corporation]

   static indexes = {
    name()
 }
}

How can I add a constraint so Person,Corporation and name are unique ?

Thanks.

© Stack Overflow or respective owner

Related posts about grails

Related posts about constraints