title: How to insert multiple rows sequentially
body: <p>I am learning hibernate, and I have a hibernate class TestAuthor, and i am inserting records into that class using 'HibernateUtil.getCurrentSession().persist' command as shown in the below code.
  the problem is, when i run that code and then check the entries in the table I found that onlx the last record was inserted. In other words, after running the below code, the table TestAuthor contains only the last record inserted
  which is 'testAuthor.setmFName("Nour"); testAuthor.setmLName("Youssri");'</p>
  
  <p>why the only the last row is inserted while the other were ignored, and how to solve this issue?</p>
  
  <p><strong>hibernate code</strong>:</p>
  
  <pre><code>    TestAuthor testAuthor = new TestAuthor();
  
      testAuthor.setmFName("Ali");
      testAuthor.setmLName("gamil");
      HibernateUtil.getCurrentSession().persist(testAuthor);
      testAuthor.setmFName("Fatma");
      testAuthor.setmLName("Joss");
      HibernateUtil.getCurrentSession().persist(testAuthor);
      testAuthor.setmFName("Lobna");
      testAuthor.setmLName("Nolan");
      HibernateUtil.getCurrentSession().persist(testAuthor);
      testAuthor.setmFName("Ahmed");
      testAuthor.setmLName("Ghadi");
      HibernateUtil.getCurrentSession().persist(testAuthor);
      testAuthor.setmFName("Nour");
      testAuthor.setmLName("Youssri");
      HibernateUtil.getCurrentSession().persist(testAuthor);
  </code></pre>
  
  <p><strong>update</strong></p>
  
  <p><strong>TestAuthor</strong>:</p>
  
  <pre><code>@Entity 
  @Table(schema = "afk_owner", name = "testauthor")
  public class TestAuthor {
  
  @Id
  @Column(name = "authorid")
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator =  
  "sequencegen")
  @SequenceGenerator(name = "sequencegen", sequenceName = 
  "afk_owner.testauthor_seq", allocationSize = 1)
  private Integer mAuthorID;
  
  @Column(name = "FNAME")
  private String mFName;
  
  @Column(name = "LNAME")
  private String mLName;
  
  @OneToMany(mappedBy = "author")
  private List&lt;TestBook&gt; books;
  
  public Integer getmAuthorID() {
      return mAuthorID;
  }
  
  public void setmAuthorID(Integer mAuthorID) {
      this.mAuthorID = mAuthorID;
  }
  
  public String getmFName() {
      return mFName;
  }
  
  public void setmFName(String mFName) {
      this.mFName = mFName;
  }
  
  public String getmLName() {
      return mLName;
  }
  
  public void setmLName(String mLName) {
      this.mLName = mLName;
  }
  
  public TestAuthor() {
      // TODO Auto-generated constructor stub
  }
  
  }
  </code></pre>