class Address {
static hasMany = [addressGroups: AddressGroup]
...
}
class AddressGroup {
static belongsTo = Address
static hasMany = [addresses: Address]
String notation;
...
}
I try to fetch all Addresses for a given AddressGroup.
My code:
def params = [max: 10]
def addressGroup = AddressGroup.findByNotation("asdf")
def addresses = Address.findAllByAddressGroups(addressGroup, params)
The error message: No value specified for parameter 2
The logged SQL statement:
select ... from ADDRESSES this_ where this_.id=10 order by this_.id asc limit ** NOT SPECIFIED **
... which is completly wrong.
Any ideas?
I could fetch the Addresses by using addressGroup.addresses (and that works!), but I want to display it in a table with pagination so i need to max / offset params.