grails « Property « JPA Q&A

1. Grails criteria, how to scape property

Domain involved:

class QuestionarioQuestao {

Questionario questionario
Questao questao
The criteria function inside domain class:
            **questao{eq("topico", Topico.get(1))}**

2. HQL : max/limit result based on property value

I have a domain, AccountTransaction

class AccountTransaction {
  Account account
  BigDecimal amount
I would like to get the maximum last 3 transactions of each account. Output expected:
id  | account ...