* On-demand query
* On-demand query
If you are using or can use Primefaces, simply include the "sortBy" property in your column
<p:dataTable value="#{testeMB.objetos}" var="o">
<p:column headerText="Nome" sortBy="#{o.nome}">
#{o.nome}
</p:column>
</p:dataTable>