Grails

Add AnyOf operator to dynamic finders

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.1-beta1
  • Component/s: None
  • Labels:
    None

Description

Adding an AnyOf constraint would allow you to perform "OR" queries where a column should have one of a range of values.

Example

def groovyAuthorBooks = Book.findByBookAnyOf(['Dierk Koenig', 'Graeme Rocher'])

This saves the user having to fall back to criteria or() clauses.

Activity

Hide
Graeme Rocher added a comment -

Ok but for consistency it should be

def groovyAuthorBooks = Book.findByBookInList(['Dierk Koenig', 'Graeme Rocher'])

since that is what it is in criteria

Show
Graeme Rocher added a comment - Ok but for consistency it should be
def groovyAuthorBooks = Book.findByBookInList(['Dierk Koenig', 'Graeme Rocher'])
since that is what it is in criteria
Hide
Graeme Rocher added a comment -

Support for findAllByFooInList([1,2,3]) added

Show
Graeme Rocher added a comment - Support for findAllByFooInList([1,2,3]) added

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: