Hi all,
I have two classes
class Event {
static belongsTo = [service: Service]
Integer
siEventId
static
constraints = {
siEventId(unique:
true)
}
}
And
class Service {
static
hasMany = [events: Event]
Integer
siServiceId
static
constraints = {
siServiceId(unique:
true)
events(nullable:
true)
}
}
I am trying to check if – for a specific object serviceInstance – I already have an Event with an Integer eventId.
I tried to do the following…
def eventInstance = Event.findAllByServiceAndSiEventId( serviceInstance, eventId )
But it seems not to be the right one… eventInstance is always null. Any suggestions?