3

I've been trying to figure out how to do something like

SELECT * FROM domain WHERE config_id IN (1, 2, 3)

when using the nice findBy technique of Grails. Haven't really figured out how yet though, is it even possible? I was hoping for something like

Domain.findByConfigIn(configList)

but that doesn't work. Anyone knows how to do this, or even if it's possible?

Lars Andren
  • 8,601
  • 7
  • 41
  • 56

1 Answers1

10

Assuming your domain class has a field named configId, the following should do what you want:

Domain.findAllByConfigIdInList(configList)
John Wagenleitner
  • 10,967
  • 1
  • 40
  • 39