Hi!
I've got a GORM question. I've got an Ad with a list of Images which is
a one-way relationship. Now I need information BACKWARDS: I have an
Image and need to find the associated Ads with it.
My simplified Ad looks like:
class Ad {
List images
static hasMany = [images:Image]
}
Now I tried the following snippet:
def image = Image.get( params.id )
def ads = Ad.executeQuery( "select a.id from Ad a where :imageId in
a.images.id", [imageId:image.id] );
but this results in
illegal attempt to dereference collection [ad0_.id.images] with element
property reference [id] [select a.id from Ad a where :imageId in
a.images.id];
I don't even know what that means. How to find the Ads which have the Image?
Any help is appreciated!
Kind regards,
Ted
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email