title: HQL extracting only one result out of multiple results
body: <p>I am running <strong>HQL</strong> query to get results from <strong>MS SQL Server</strong>. The hibernate generated SQL gives the correct output(2 results for eg,) but Hibernate only extracts one result. Even in the stack trace it shows that the query returned one result. I have tried using order by desc and asc but it always gets the one with the lowest ID value. I have looked at my model but there seems to be no fault with it. </p>
  
  <p>I am using <code>createquery("my query").list()</code> method. Did someone encountered the same issue?</p>
  
  <p><code>createquery("from Analysis a where a.sample = *someNumber* ").list()</code></p>
  
  <p>The HQL generated SQL gives correct results when I run this on the database</p>
  
  <p><code>select
          analysis0_.idAnalysis as idAnalys1_5_,
          analysis0_.changes_timestamp as changes_2_5_,
          analysis0_.Analysis_Done_Date as Analysis3_5_,
          analysis0_.Analysis_Remarks as Analysis4_5_,
          analysis0_.Sample_idSample as Sample_i5_5_,
          analysis0_.Analysis_Start_Date as Analysis6_5_,
          analysis0_.Analysis_Status as Analysis7_5_ 
      from
          Re_at_AIM_User.analysis analysis0_ 
      where
          analysis0_.Sample_idSample=*someNumber*</code></p>
  
  <p>public class Analysis implements Serializable {</p>
  
  <pre><code>private static final long serialVersionUID = -1216945678610624994L;
  
  @Column(name = "changes_timestamp", columnDefinition = "datetime")
  @Temporal(TemporalType.TIMESTAMP)
  private Date changesTimestamp;
  
  
  @Column(name = "Analysis_Done_Date", columnDefinition = "datetime")
  @Temporal(TemporalType.TIMESTAMP)
  private Date doneDate;
  
  @Id
  @Column(name = "idAnalysis", columnDefinition = "bigint")
  private Integer id;
  
  @Column(name = "Analysis_Remarks")
  private String remarks;
  
  @Column(name = "Analysis_Start_Date", columnDefinition = "datetime")
  @Temporal(TemporalType.TIMESTAMP)
  private Date startDate;
  
  @Column(name = "Analysis_Status")
  private String status;
  
  @ManyToOne()
  @JoinColumn(name = "Sample_idSample")
  private Sample sample;
  
  public Analysis() {
  }
  
  public Date getChangesTimestamp() {
      return changesTimestamp;
  }
  
  
  
  public Date getDoneDate() {
      return doneDate;
  }
  
  public Integer getId() {
      return id;
  }
  
  
  public String getRemarks() {
      return remarks;
  }
  
  public Date getStartDate() {
      return startDate;
  }
  
  public String getStatus() {
      return status;
  }
  
  public void setChangesTimestamp(Date changesTimestamp) {
      this.changesTimestamp = changesTimestamp;
  }
  
  
  
  public void setDoneDate(Date doneDate) {
      this.doneDate = doneDate;
  }
  
  public void setId(Integer idAnalysis) {
      this.id = idAnalysis;
  }
  
  public void setRemarks(String remarks) {
      this.remarks = remarks;
  }
  
  public void setStartDate(Date startDate) {
      this.startDate = startDate;
  }
  
  public void setStatus(String status) {
      this.status = status;
  }
  
  public Sample getSample() {
      return sample;
  }
  
  public void setSample(Sample sample) {
      this.sample = sample;
  }
  </code></pre>
  
  <p>}</p>