title: NamedQuery resultList returning objects, but all values are null
body: <p>I have a table in database with these columns:</p>
  
  <pre><code>   id serial NOT NULL, 
     name character varying(255) NOT NULL, 
     url character varying(255)
  </code></pre>
  
  <p>The Entity:</p>
  
  <pre><code>    @Entity
      @Table(name = "Topmenu")
      @XmlRootElement
      @NamedQueries({
          @NamedQuery(name = "Topmenu.findAll", query = "SELECT t FROM Topmenu t"),
          @NamedQuery(name = "Topmenu.findById", query = "SELECT t FROM Topmenu t WHERE t.id = :id")})
      public class Topmenu implements Serializable {
  
          private static final long serialVersionUID = 1L;
          @Id
          @GeneratedValue(strategy = GenerationType.IDENTITY)
          @Basic(optional = false)
          @Column(name = "id")
          private Integer id;
          @Basic(optional = false)
          @Column(name = "name")
          private String name;
          @Column(name = "url")
          private String url;
  
          public Topmenu() {
          }
  
          public Topmenu(Integer id) {
              this.id = id;
          }
  
          public Topmenu(Integer id, String name) {
              this.id = id;
              this.name = name;
          }
  
          public Integer getId() {
              return id;
          }
  
          public void setId(Integer id) {
              this.id = id;
          }
  
          public String getName() {
              return name;
          }
  
          public void setName(String name) {
              this.name = name;
          }
  
          public String getUrl() {
              return url;
          }
  
          public void setUrl(String url) {
              this.url = url;
          }
  
          @Override
          public int hashCode() {
              int hash = 0;
              hash += (id != null ? id.hashCode() : 0);
              return hash;
          }
  
          @Override
          public boolean equals(Object object) {
              // TODO: Warning - this method won't work in the case the id fields are not set
              if(!(object instanceof Topmenu)) {
                  return false;
              }
              Topmenu other = (Topmenu) object;
              return !((this.id == null &amp;&amp; other.id != null) || (this.id != null &amp;&amp; !this.id.equals(other.id)));
          }
  
          @Override
          public String toString() {
              return "erates.entity.Topmenu[ id=" + id + " ]";
          }
  }
  </code></pre>
  
  <p>Netbeans generated the JPA Entity for me. I have 5 records in the database. When I do <code>em.createNamedQuery("Topmenu.findAll").getResultList();</code> I get a <code>List&lt;Topmenu&gt;</code> with 5 entries, but when I do the following, nothing is returned:</p>
  
  <pre><code>for(Topmenu t : em.createNamedQuery("Topmenu.findAll").getResultList()){
      logger.warn(t.getName());
  }
  </code></pre>
  
  <p>The Named query:</p>
  
  <pre><code>@NamedQuery(name = "Topmenu.findAll", query = "Topmenu t FROM Topmenu t")
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>2015-06-01 11:23:27,024 WARN erates.beans.TopmenuBean (TopmenuBean.java:33) -
  2015-06-01 11:23:27,034 WARN erates.beans.TopmenuBean (TopmenuBean.java:33) -
  2015-06-01 11:23:27,045 WARN erates.beans.TopmenuBean (TopmenuBean.java:33) -
  2015-06-01 11:23:27,055 WARN erates.beans.TopmenuBean (TopmenuBean.java:33) -
  2015-06-01 11:23:27,066 WARN erates.beans.TopmenuBean (TopmenuBean.java:33) -
  </code></pre>