title: Spring JPA result query with right number of rows but with empty fields
body: <p>I´m new with Spring and JPA, and I´m trying to get a list of elements with JPA query, but what i´m getting is a list with the right number of rows (the same query on sqldeveloper returns the same number of rows) but with all fields with null value.</p>
  
  <p>Here is my code for Entity:</p>
  
  <pre><code>@Entity
  @IdClass(MTINPTEPK.class)
  @Table(name = "MTIN_PTE")
  @NamedNativeQueries({
      @NamedNativeQuery(resultClass=MTINPTE.class,name = "MTINPTE.findByFechas", query=
              "SELECT "
              + "' ' AS CAMPO1, EEXIDE, ' ' AS CAMPO2, ' ' AS CAMPO3, ' ' AS CAMPO4, EEXNAC,
  ...
  
  public class MTINPTE {
  
  
      @Column(name="CAMPO1") 
      private String campo1;
      @Id
      @Column(name="EEXIDE")
      private String eexide;
  
      @Column(name="CAMPO2")
      private String campo2;
  
      @Column(name="CAMPO3")
      private String campo3;
  
      @Column(name="CAMPO4")
      private String campo4;
      @Id
      @Column(name="EEXNAC")
      private String eexnac;
  </code></pre>
  
  <p>The PK</p>
  
  <pre><code> public class MTINPTEPK implements Serializable{
  
          private String campo1;
          private String eexide;
          private String campo2;
          private String campo3;
          private String campo4;
          private String eexnac;
  ...
  </code></pre>
  
  <p>The repo</p>
  
  <pre><code>public interface MTINPTERepository extends CrudRepository&lt;MTINPTE, MTINPTEPK&gt; 
  {
      @Query
      public List&lt;MTINPTE&gt; findByFechas(Date fechaDesde, Date fechaHasta);    
  
  }
  </code></pre>
  
  <p>And the service</p>
  
  <pre><code>List&lt;MTINPTE&gt; listaMTINPTE = mtinPteRepository.findByFechas(fechaInicio, fechaFin);
  </code></pre>
  
  <p>Well, when I try to execute findByFechas I get the right number of rows on listaMTINPTE.size(), but the fields of each element are null. </p>
  
  <p>Can you give me a hand?</p>
  
  <p>Thanks!!.</p>