| Autor |
Mensagem |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 08/06/2011 17:04:44
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Tenho uma TreeSet que contém alguns "VOs", que já popuplado do banco :
Ele me ordena automaticamente pelo nome, queria alterar a ordenação para o ID ( sequencial), alguém saberia como faço isso ?
Desde já agradeço !
This message was edited 2 times. Last update was at 11/06/2011 20:23:36
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 08/06/2011 18:39:12
|
pmlm
GUJ Master
Membro desde: 20/04/2009 12:20:07
Mensagens: 1199
Localização: Portugal
Online
|
O teu VO tem de implementar a interface Comparable e depois implementas o método compareTo como pretendes.
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 08/06/2011 22:38:26
|
entanglement
GUJ Hacker
Membro desde: 26/09/2009 09:18:56
Mensagens: 5750
Offline
|
This message was edited 2 times. Last update was at 08/06/2011 22:39:31
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 09/06/2011 14:50:46
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
pmlm wrote:O teu VO tem de implementar a interface Comparable e depois implementas o método compareTo como pretendes.
Obrigado a todos, usei da seguinte forma :
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
|
|