class Person { Long id Long version String name String pass def constraints = { name(length:8..30, blank:false, unique:true) password(length:6..10,blank:false) } }
Person.findByName('yamada') //<= "yamada"という名前のPersonを検索 Person.listOrderByAge() //<= "age"順にPersonの一覧を取得