I know that we can get the primary key of the newly inserted record with object.getId()
when we do hibernate session.save(object)
. I want to understand how is hibernate getting this id. I want to achieve the same using a plain SQL query instead of using hibernate.
DB Server is MySQL.