Explicitly enabling in-memory sorting for a view object
Sharing a tip that I learned while debugging an issue ;)
When you try to sort a UI component such as af:table bound to a view object, framework by default fire SQL ORDER BY clause if the selected column is not a transient one, otherwise framework will go for an in-memory sort by calling setSortCriteria(...) on the ViewObject.
You can override this default behavior by setting a custom property on the ViewObject. This make sense if your view object is a programmatic or transient view object or if the view object contains uncommitted rows.To do this, you need to set a property named PROP_ALWAYS_USE_SORT to true (available in 11.1.1.7.0 release). When PROP_ALWAYS_USE_SORT is 'true', framework will always go for in-memory sorting.
Example:
empVO.setProperty(ViewObject.PROP_ALWAYS_USE_SORT, "true");
Warning: Note that when you enable in-memory sorting, framework will fetch all the records from the DB before performing the sort. So it makes sense only if you have limited number of rows.
When you try to sort a UI component such as af:table bound to a view object, framework by default fire SQL ORDER BY clause if the selected column is not a transient one, otherwise framework will go for an in-memory sort by calling setSortCriteria(...) on the ViewObject.
You can override this default behavior by setting a custom property on the ViewObject. This make sense if your view object is a programmatic or transient view object or if the view object contains uncommitted rows.To do this, you need to set a property named PROP_ALWAYS_USE_SORT to true (available in 11.1.1.7.0 release). When PROP_ALWAYS_USE_SORT is 'true', framework will always go for in-memory sorting.
Example:
empVO.setProperty(ViewObject.PROP_ALWAYS_USE_SORT, "true");
Warning: Note that when you enable in-memory sorting, framework will fetch all the records from the DB before performing the sort. So it makes sense only if you have limited number of rows.
hi Jobinesh,
ReplyDeleteMay be this is what I was exactly looking for. But my ViewObject doesnot have that 'PROP_ALWAYS_USE_SORT' static variable. I am using Jdev 11.1.1.6.0.
In which version it is supported.
If you can , please see my forum thread. I need solution for this
https://forums.oracle.com/forums/thread.jspa?threadID=2531973&tstart=0
Regards,
Neha..
Neha,
ReplyDeleteThis property is available in 11.1.1.7.0
Thanks for the info. I guess I am looking for a way to do this declaratively from ADF Faces. From what I can gather from section 27.5, I see a way to sort in memory if I am writing the code to interact with the view object. But I am trying to use af:table and data binding and not write the low-level code. Since the rich-client af:table has a sorting capability built-in, I want to have a way to tell the framework to sort in memory. To get more info please visit http://researchpapergiant.com/research-paper-examples/.
ReplyDeleteYou can also use the view to set the query mode.
ReplyDeletevo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
Valuable blog....waiting for next update...
ReplyDeleteSpring Training in Chennai
spring hibernate training institutes in chennai
Spring Hibernate Training in Chennai
spring Training in Anna Nagar
spring Training in T Nagar
Hibernate Training in Chennai
javascript training in chennai
QTP Training in Chennai
Mobile Testing Training in Chennai
SAS Training in Chennai
Awesome blog...thanks for sharing valuable articles.....
ReplyDeleteStruts Training in Chennai
Struts Training
struts course
struts training in vadapalani
struts training in Guindy
Wordpress Training in Chennai
SAS Training in Chennai
Spring Training in Chennai
Photoshop Classes in Chennai
DOT NET Training in Chennai
More impressive blog!!! Thanks for shared with us.... waiting for you upcoming data.
ReplyDeleteSoftware Testing Training in Chennai
software testing course in chennai
testing courses in chennai
software testing training institute in chennai
Software testing training in Thiruvanmiyur
Software testing training in Velachery
Python Training in Chennai
Digital marketing course in chennai
Python Training in Chennai
JAVA Training in Chennai
Great Post!!! Thanks for the data update and waiting for your new updates.
ReplyDeleteAndroid Training in Chennai
android classes in chennai
Android Training Institute in Chennai
android development course in chennai
Android training in Thiruvanmiyur
Android Training in Velachery
Python Training in Chennai
Software testing training in chennai
Python Training in Chennai
JAVA Training in Chennai
Really informative Blog...Thanks for sharing...Waiting for next update...
ReplyDeleteWordpress Training in Chennai
Wordpress Training
wordpress course fees
wordpress training in vadapalani
wordpress training in Guindy
Struts Training in Chennai
clinical sas training in chennai
Spring Training in Chennai
Photoshop Classes in Chennai
LoadRunner Training in Chennai
Nice Blog, Very Informative Content,waiting for next update...
ReplyDeleteSAS Training in Chennai
SAS Course in Chennai
SAS Training Institute in Chennai
SAS Training in OMR
SAS Training in Porur
clinical sas training in chennai
Mobile Testing Training in Chennai
QTP Training in Chennai
Hibernate Training in Chennai
DOT NET Training in Chennai