Skip to main content
Known Participant
February 23, 2010
Question

CF9 ORM Load Array Of Entities where value NEQ to

  • February 23, 2010
  • 2 replies
  • 673 views

Hi there

Trying to achieve something in CF9 ORM and not sure whether it is possible

I am aware you can filter results within the entityLoad function, as so

<cfset artists = EntityLoad('artist',{firstname = "john"})>

But am wondering how I would restructure this to say select all artist entities whose firstname is not john...

Using the following code brings up an error

<cfset artists = EntityLoad('artist',{firstname <> "john"})>

Any ideas? I presume I would have to use ORMExecuteQuery?

Many thanks

    This topic has been closed for replies.

    2 replies

    Inspiring
    February 28, 2010

    You might want to look at ormExecuteQuery() rather than entityLoad() for that.

    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSfd7453be0f56bba45b6e22cb12308efc3aa-8000.html

    --

    Adam

    namtaxAuthor
    Known Participant
    March 1, 2010

    Yeah, i ended up using ormexecutequery to get this to work..

    Many thanks

    Participant
    February 26, 2010

    I have a similar question. How would I select entities with multiple values for a particular property, as with a SQL IN statement:

    WHERE account_id IN (1,2,3)

    Any help is much appreciated!