package nardhar.oauth

import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString

@EqualsAndHashCode(includes='authority')
@ToString(includes='authority', includeNames=true, includePackage=false)
class Role implements Serializable {

   private static final long serialVersionUID = 1

   String authority

   Role(String authority) {
      this()
      this.authority = authority
   }

   static constraints = {
      authority blank: false, unique: true
   }

    static mapping = {
        cache true
	    table name: 'role', schema: 'public'
	    id generator: 'sequence', params: [sequence: 'public.sq_role_id']
	}
}