Hello All, Hope you are doing good
Previously I have posted about In-Memory filtering of ViewObject by changing ViewCriteria’s query execution mode, Now this post is about In-Memory sorting of records in viewObject. By default sorting and filtering in viewObject works on the rows retrieved from DB. We can change ViewObject Query mode as per our requirement, There are 3 different SQL query mode of the view object and one line description is given below for the basic understanding of default query modes.
QUERY_MODE_SCAN_DATABASE_TABLES – Default query mode of ViewObject, Only rows from the database.
QUERY_MODE_SCAN_VIEW_ROWS – Use the rows in memory (DB n New rows).
QUERY_MODE_SCAN_ENTITY_ROWS – Use entity objects rows, valid for entity-based view objects)
Here I am taking Departments table of HR Schema to prepare the model
Dropped Departments ViewObject as a table on the page and CreateInsert operation as a button
Created a new row with DepartmentId 300 and after sorting on DepartmentId column we can see that only DB records are sorted
For In-Memory sorting of records added a button on the page and created a method in the managed bean that changes VO query mode- performs sorting – execute viewObject
And after clicking on InMemory Sort button
Cheers 🙂 Happy Learning
An Oracle ACE, Blogger, Reviewer, Technical Lead working on Oracle ADF