title: Hibernate query gives same record multiple times
body: <p>I am working on hibernate in eclipse. I am executing simple 'From' query. Here is the code</p>
  
  <pre><code>  List list = sess1.createQuery("From Myview").list();
      System.out.println("Records Found :"+list.size());
  
      Iterator&lt;Myview&gt; i = list.iterator();
  
      while(i.hasNext())
      {
          Myview nS = i.next();
          System.out.println(nS.getFirstName()+" -- "+nS.getLastName()+" -- "+nS.getAddressLine1());
      }
  </code></pre>
  
  <p>The problem is the list.size() returns 11, which is right as i have 11 records in my table.
  But when i am in while loop, the same records shown multiple times and the loop termintes after 11th iteration. here is my output</p>
  
  <p><img src="https://i.stack.imgur.com/mP5yJ.jpg" alt="enter image description here"></p>
  
  <p>here is what i want</p>
  
  <p><img src="https://i.stack.imgur.com/NR5Ry.jpg" alt="enter image description here"></p>
  
  <p>Now you can see that in my output, record is displayed 11 times but the same record is repeated again and again. And what i need is the output displayed in the later image.</p>
  
  <p>Kindly help me in this regard, as i am new to hibernate</p>