New Posts New Posts RSS Feed: Where clause in entity
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Where clause in entity

 Post Reply Post Reply
Author
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Topic: Where clause in entity
    Posted: 12-Jul-2007 at 5:07pm

I have an issue/clarification with regards to where clause definition in the entity.

  • Say I have two entities Order (parent) and OrderDetail (child). OrderDetail has a where clause “status = ‘Active’”.
  • When I do Order.OrderDetails, I get a managed list with a predicate applied.
  • Now If set the “status” property for one of the OrderDetail entity from the managed list to “InActive”, I expect the entity to be removed from the managed list as it doesn’t satisfy the entity where clause. But it doesn’t seem to be.
Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 5:09pm

You are correct about the behavior of the "Where" clause. 

The "Where" clause was intended for distinguishing among records with a FIXED discriminator column. It will not work for any column whose value can change ... nor was it supposed to.

The "Where" clause  was designed to separate State codes from Shipping codes when both such codes resided in the same table. A State code never becomes a Shipping code (nor vice versa). 

However, any object can be active or inactive and switch between the two.

Perhaps our documentation is unclear on that point - I'm forwarding this to our docs guy. 

You can teach your managed list to remove an inactive object. That is standard ManagedList coding; please check with support if you need to know more.

There are other more challenging issues associated with "logical delete" operations such as are likely to be associated with your "inactive" flag. I don't want to anticipate those now :-) but I have some guidelines when you are ready.

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down