Removing a row from a rowset without deleting it from the database
There are times when you want to remove a row from the view object's query collection (the query result set) without actually removing it from the database. The query collection, oracle.jbo.server.QueryCollection
, gets populated each time the view object is executed—when the view object's associated query is run—and represents the query result. While the Row.remove()
method will remove a row from the query collection, it will also remove the underlying entity object for an entity-based view object, and post a deletion to the database. If your programming task requires the row to be removed from the query collection itself, that is, removing a table row in the UI without actually posting a delete to the database, use the Row
method removeFromCollection()
instead.
Note
Note, however, that each time the view object query is re-executed the row will show up, since it is not actually deleted from the database.
This recipe will...