nSuporta parâmetros posicionais (1,2...) e nomeados
n@SuppressWarnings("unchecked")
nList<Comunidade>
comunidades =
n em.createQuery("from Comunidade").getResultList();
n
nList<Comunidade>
comunidades =
n em.createQuery("from Comunidade c where c.nome = ?")
n.setParameter(1, "Java").getResultList();
n
nList<Comunidade>
comunidades =
n
em.createQuery("from Comunidade c where c.nome
= :nome").setParameter("nome", "Java").getResultList();
n
nList<Comunidade>
comunidades =
nem.createQuery("from
Comunidade c where c.nome = ?1
nand
c.descricao like ?2").setParameter(1, "Java")
n.setParameter(2, "%Programadores%").getResultList();