title: hibernate main method call
body: <p>I'm very new to Hibernate and just wanted to query the initial basics.</p>
  
  <p>I've created my Hibernate bean as such...</p>
  
  <pre><code>package com.behaviour.chapter1;
  
  import javax.persistence.Entity;
  import javax.persistence.Id;
  
  @Entity
  public class User {
  
      private int userId;
      private String firstName;
  
      @Id
      public int getUserId() {
          return userId;
      }
      public void setUserId(int userId) {
          this.userId = userId;
      }
      public String getFirstName() {
          return firstName;
      }
      public void setFirstName(String firstName) {
          this.firstName = firstName;
      }
  }
  </code></pre>
  
  <p>I've configured my hibernate.cfg.xml and db connection there.  My question is simply, how do I actually call this from a main method and use it in Hibernate3.6.6?  I was following a tutorial online but it was for Hibernate3.2 and it seems to be a bit different.  If anyone could show me just a really simple main method calling this bean, creating a new user (that would create a user in this table) it would be greatly appreciated.  Also - if anyone has any good Hibernate tutorial links that would be great :)</p>
  
  <p>Thanks,</p>