title: get auto generated key, on save, using hibernate + spring mvc
body: <p>I am using <strong>Spring MVC + Hibernate</strong> </p>
  
  <pre><code>@Resource(name = "sessionFactory")
  private SessionFactory sessionFactory;
  
  // save
  public &lt;T&gt; int save(T entity) throws DataAccessException {
      Session session = sessionFactory.getCurrentSession();
      session.save(entity);
  
  }
  </code></pre>
  
  <p>As New Record Save , New Primary Key generated which in auto increment (db.MySQL). I want to get and return the new auto incremented value with respect to the above method.</p>
  
  <p>Update me !</p>