| Author |
Help me in using a Comparable with ArrayList for Sorting purpose
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Hi ,
I have defined a DTO of a Employee with name , age and other properties .
On to the EMployeeDTO i have overriden the compareTo method as required for my business .
Please tell me what should i do on to my DAO Layer of getEmployeeDetails() , so that i can display the results as per the Name order of the Employee .
I am struck up here
After filling the ArrayList with the Employees .
All the examplyes of Net uses Collections.sort(list , ComparatorObject);
But in my case it is of a Comparable
Please share your ideas
Thanks in advance .
|
Save India From Corruption - Anna Hazare.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Check out the other methods of java.util.Collections.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Thanks Rob for the quick response , you mean to say that
is sufficient .
waiitng for your response . Thank you.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
That was exactly the method I wanted you to find.
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
|
Thank you .
|
 |
 |
|
|
subject: Help me in using a Comparable with ArrayList for Sorting purpose
|
|
|