Difference between findAll, getAll and list in Grails

后端 未结 3 1164
借酒劲吻你
借酒劲吻你 2021-01-30 08:28

With Grails there are several ways to do the same thing.

Finds all of domain class instances:

Book.findAll()
Book.getAll()
Book.list()

3条回答
  •  有刺的猬
    2021-01-30 09:20

    Another difference between Domain.findByID(id) and Domain.get(id) is that if you're using a hibernate filter, you need to use Domain.findById(id). Domain.get(id) bypasses the filter.

提交回复
热议问题