Home » Developer & Programmer » JDeveloper, Java & XML » Sorting Issue in ViewObject(Without database trip i want to sort fetched record by column)
icon11.gif  Sorting Issue in ViewObject(Without database trip i want to sort fetched record by column) [message #274265] Mon, 15 October 2007 04:54 Go to next message
janak.nirmal
Messages: 5
Registered: October 2007
Junior Member
Hello,

I am having 1 view which is fetching some records from database. Now my requirement is that i want to sort those records by column name without going to database.

I am using Jdeveloper 10.1.2.1.0 which does not have such kind of facility compare to new Version 10.1.3.

Does anybody have any idea how it can be accomplish ?

any help would be heartily appreciated...

Thanks in advance

Janak
Re: Sorting Issue in ViewObject(Without database trip i want to sort fetched record by column) [message #274273 is a reply to message #274265] Mon, 15 October 2007 05:14 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
I really doubt if that would be possible, since the data is fetched in batches, based on the previous order..
This can only work if the set you display is the complete set (or you only want to sort the displayed set)
Re: Sorting Issue in ViewObject(Without database trip i want to sort fetched record by column) [message #274279 is a reply to message #274273] Mon, 15 October 2007 05:46 Go to previous messageGo to next message
janak.nirmal
Messages: 5
Registered: October 2007
Junior Member
Hello Frank,

Thank you so much for immediate response.

I surfed for this issue and i got 1 link

http://radio.weblogs.com/0123729/2003/10/09.html

Here everything is mentioned for the issue i am having. I tried this solution but it get stuck when implemented.

It is going in infinite loop somewhere in condition.

Please if you can look at this code and suggest any changes may be I will get solution.

Once again Thanks a lot for immediate response.

Thanks
Janak
Re: Sorting Issue in ViewObject(Without database trip i want to sort fetched record by column) [message #274350 is a reply to message #274279] Mon, 15 October 2007 13:19 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
janak.nirmal wrote on Mon, 15 October 2007 12:46


I surfed for this issue and i got 1 link

http://radio.weblogs.com/0123729/2003/10/09.html

Ok, that's good you found an example!

Quote:

It is going in infinite loop somewhere in condition.

I don't see a method called condition.
How do you know it is in an infinite loop? The only way of knowing is to use debug. That should also reveal the reason why it does not get out.
Since I have no idea in which part you are looping, I cannot help you out.
icon13.gif  Re: Sorting Issue in ViewObject(Without database trip i want to sort fetched record by column) [message #274409 is a reply to message #274350] Mon, 15 October 2007 23:55 Go to previous messageGo to next message
janak.nirmal
Messages: 5
Registered: October 2007
Junior Member
Hi Frank,

Once again Thank you to have a look at issue.

I debug the execution.

In the method executeQueryForCollection() it goes perfactly for the first time and creates new view on the basis of current view.

Than sortData(qc) is called. It also gets executed fine. Now when
super.executeQueryForCollection(qc, params, noUserParams); is executed it goes into

createRowFromResultSet(Object qc,ResultSet resultSet) method here mSortData is getting always true as it is true by default.

So else part is executed in IF condition.

Here it is coming in another IF condition beneath the ELSE Part condition and i put System.out.println in that part like this .

system.out.println("before indx ---->"+indx );
ViewRowImpl rowBase=(ViewRowImpl)mUnsortedBaseVO.getRowAtRangeIndex(indx);
system.out.println("after indx ---->"+indx );

now here it is not print these after SOP. so i m confused that what is wrong with this.

Please Help out if you can.

Once Again Thanks,

Janak
Re: Sorting Issue in ViewObject(Without database trip i want to sort fetched record by column) [message #274448 is a reply to message #274409] Tue, 16 October 2007 01:58 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Did you wrap the line in a try-catch (Exception e)?
It might be that it fails, causing the after indx not to be printed. That would make you search in the wrong place.
Re: Sorting Issue in ViewObject(Without database trip i want to sort fetched record by column) [message #276792 is a reply to message #274448] Fri, 26 October 2007 06:03 Go to previous messageGo to next message
janak.nirmal
Messages: 5
Registered: October 2007
Junior Member
Hello Frank

I want to know that whether executeQueryCollection() method will go to database and fetch the result or what ?

I solved the problem and now I am getting sorted records. But now my question is that whether view is going to fetch data from database when i m sorting records.

Can you help me out ?

Thanks,
Janak
Re: Sorting Issue in ViewObject(Without database trip i want to sort fetched record by column) [message #276802 is a reply to message #276792] Fri, 26 October 2007 06:11 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
That should be easy enough to test.
Fetch your data, update the data in the database & commit, and then call executeQueryForCollection()
Re: Sorting Issue in ViewObject(Without database trip i want to sort fetched record by column) [message #277555 is a reply to message #276802] Tue, 30 October 2007 09:32 Go to previous message
janak.nirmal
Messages: 5
Registered: October 2007
Junior Member
Hello Frank,

I checked about it and it is reflecting the data.

Can you tell me executeQuery() method of ViewObject is actually going in database or what ?

how do it fetches the records ? I mean whether to go in database or from cache ? how does Shocked the viewobject knows from where to fetch data?

I mean everytime it is going in database. So what is the benefit of having view Shocked .

Thanks,
Janak
Previous Topic: too many process with Connection OCI
Next Topic: Removing Whitespace from XML with DBMS_XMLGEN
Goto Forum:
  


Current Time: Mon Dec 05 09:11:58 CST 2016

Total time taken to generate the page: 0.14480 seconds