-1
When I return all the values of the bank, it works. However, I look only at the columns id, celular, cpf, nome, status to list in the table, returns error. Would be the type of return that is wrong? Could you give me an example that works? Thanks in advance.
Mistake to follow:
My Personal Entity has these attributes:
@Id
@GeneratedValue
private long id;
private Date data; // DATA 
private String nome; // NOME 
private String cpf; // CPF 
private String celular; // NUMERO DE CONTATO
private String usrAteracao; // USUARIO QUE ALTEROU
private String status; // INFORMA SE ESTA PENDENTE OU CONCUIDA
private byte[] imagem; // IMAGEM 
My bean:
...
private List<Pessoa> listaPessoa;
...
// Lista Pessoa
public void listaPessoa(){
    try {
        listaPessoa = pessoaDAO.listaPessoa("PENDENTE");
        System.out.println("Lista: "+listaPessoa ); // imagem abaixo
        quant_na_lista = 0;
        for (Pessoa q : listaPessoa ) { // NÃO ENTRA NESSA CONDIÇÃO
            quant_na_lista += 1;
        }   
        onlistaPessoa();
        
    } catch (Exception e) {
        System.out.println(e);
    }
    
}   
// Lista pessoa
public List<Pessoa> onlistaPessoa(){
    return listaPessoa;
}
In my DAO I do not seek all the columns.
// LISTA DE RETORNO DE PESSOA
@SuppressWarnings("unchecked")
public List<Pessoa> listaPessoa(String status) {
    Query query = null;     
    try {
        query = entityManager.createQuery("SELECT id, celular, cpf, nome, status FROM Pessoa where status = :status");
        query.setMaxResults(2);
        query.setParameter("status", status);
        
        return (List<Pessoa>) query.getResultList();
    } catch (Exception e) {
        System.out.println(e);
    }
    return null;
}
My xhtml table:
<p:dataTable value="#{listaPessoaBean.listaPessoa}" paginator="true" rows="10" var="pessoa"  emptyMessage="Nenhuma pendente!" paginatorPosition="bottom">
    
     <f:facet name="header">
           <label>Pendentes</label>
     </f:facet>
    <p:column headerText="Nome" style="width: 15%;text-align:center" sortBy="#{pessoa.nome}" filterBy="#{pessoa.nome}">
        <h:outputText value="#{pessoa.nome}" />
    </p:column>
    
    <p:column headerText="CPF" style="width: 15%;text-align:center" sortBy="#{pessoa.cpf}" filterBy="#{pessoa.cpf}" >
        <center><h:outputText value="#{pessoa.cpf}" /></center>
    </p:column>
 
    <p:column headerText="Contato"  style="text-align:center">
     <center> <h:outputText value="#{pessoa.celular}" /></center>
    </p:column>
    
</p:dataTable>


Failed to close string
String hql = " from Pessoa p where p.status = :status;– Augusto Vasques