5 Replies Latest reply on Nov 29, 2009 7:30 PM by I need a real name

    rowCount and EntityManager

    I need a real name Newbie


      I want to see how many users are registered:

      <h:outputText styleClass="outputText" value="#{userList.rowCount} Users"/>

      public class RegistrationStats implements RegistrationStatsInterface {
           private EntityManager entityManager;
           private List<User> userList;
           public void populateUserList() {
                userList = entityManager.createQuery("SELECT COUNT(*) FROM User").getResultList();

      public interface RegistrationStatsInterface {     
           public void populateUserList();

      But I always get 1 user registered.

      Please can you help me?