I get the following error session.save(student);
org.hibernate.HibernateException: The database returned no natively generated identity value
Here is main function
{
BasicConfigurator.configure();
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction transaction = null;
try {
transaction = session.beginTransaction();
Address address = new Address("Outer Ring Road", "Delhi", "TN", "110001");
Student student = new Student("kumar", address);
session.save(student);
transaction.commit();
} catch (HibernateException e) {
if (transaction != null) {
transaction.rollback();
}
e.printStackTrace();
} finally {
session.close();
}
}