Get Id after saving a row in database using hibernate
<p>I am using this code to save a row in database.
The id is not self generated from hibernate.I have a trigger in database which is generating id.
Once i save the row in database through hibernate,i need to get the id generated by trigger for that row.</p>

<pre><code>public long saveInspectionMaster(HInspectionMaster s) {
    Session session = this.sessionFactoryCommon.openSession();
    session.getTransaction().begin();
    session.save(s);
    System.out.println("--------------------------------------");
    session.getTransaction().commit();
    return 0;
}
</code></pre>

<p>Is there anyway i can get the id after saving row.Because there is no other unique key in database except ID.</p>