There are some drawbacks to using the SqlWhere clause for filtering:
· DevForce does not validate “Sql Where” clause text; if it is not valid for the runtime database, DevForce will pass the database exception back to the caller.
· The clause applies only for database OQL queries when they resolve into SQL queries applied to the database table. The clause is ignored when the OQL generates a query against the entity cache and it plays no role in any other kind of entity query such as a PassThru SQL or Stored Procedure Query.
· The clause can only be used to differentiate immutable objects. In other words, if a change occurs such that an OrderDetail should belong to this filtered list, the OrderDetail will not become part of the list immediately; first you must save it, remove it from the cache, then re-fetch the OrderDetail object.
To filter instances dynamically, you might consider using an EntityListManager as described in the following tech tip:
Edited by eileenv - 18-Oct-2007 at 6:28pm