hibernate - how to define if domain has more than one unique field in grails? -


My domain has more than one unique field like the following

  square shoes {string of Name; Brand brand; Color color; Supplier Supplier; Integer shape; BigDec price; }  

The name, brand, color and supplier should be exclusive ... so if the same name is a product with a brand color and supplier then it will return as a false / false confirmation.

Is it possible to define in grille or should I prepare the criteria before saving the form? :)

Thank you!

  static constraints = {name unique: ['brand' , 'Color', 'Supplier']}  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -