Quantcast

GORM findAllWhere.... NOT?!

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

GORM findAllWhere.... NOT?!

webmediauk
Hey Guys,
Is there a simple way to get all the domain objects of a certain class except one with a given id?
I'm not explaining myself very clearly here! so you can do this with GORM:

Form.findAllWhere( id: 8 )

I am trying to achieve the reverse...

Form.findAllWhereNOT( id: 8 )

I'm sure I could do it with Criteria but is there an easier way?
Thanks
Barry
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: GORM findAllWhere.... NOT?!

tomas lin
Form.findAllByIdNotEqual( 8 )

On Tue, Feb 21, 2012 at 6:08 PM, webmediauk <[hidden email]> wrote:

> Hey Guys,
> Is there a simple way to get all the domain objects of a certain class
> except one with a given id?
> I'm not explaining myself very clearly here! so you can do this with GORM:
>
> Form.findAllWhere( id: 8 )
>
> I am trying to achieve the reverse...
>
> Form.findAllWhereNOT( id: 8 )
>
> I'm sure I could do it with Criteria but is there an easier way?
> Thanks
> Barry
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/GORM-findAllWhere-NOT-tp4407801p4407801.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: GORM findAllWhere.... NOT?!

webmediauk
Perfect!
Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: GORM findAllWhere.... NOT?!

will.woodman
In reply to this post by webmediauk
I think you can try

Class xyz.findAllIdNotEqual (<,your id>)
Loading...