I'm developing a restaurant system and I have a dataGrid that updates the other. For example: I click on the class and update the product dataGrid.
It works, but the result is a bit slow.
I'm using a <h:commandLink>
with update:
<p:commandLink actionListener="#{mesaControle.setClasseFiltro(grupo)}"
action="#{mesaControle.validaBuscarProduto()}"
update="form:produtos">
<button style="background-color: #0b66b1; height: 55px; width: 100px;">
<br/>
<strong style="color: #f6f6f6">#{grupo.nome}</strong></button>
</p:commandLink>
And filter as follows:
public List<Produto> listaClasse(Classe produtoFiltro) {
Query q = em.createQuery("FROM Produto As a WHERE a.classe = :para order by id asc");
q.setParameter("para", produtoFiltro);
return q.getResultList();
}
Everything works perfectly, but performance leaves something to be desired. How can I improve performance?