I solved the error by modifying the following property in hibernate.cfg.xml
<property name="hibernate.hbm2ddl.auto">validate</property>
Earlier, the table was getting deleted each time I ran the program and now it doesnt, as hibernate only validates the schema and does not affect changes to it.
As far as I know you can also change from validate to update e.g.:
<property name="hibernate.hbm2ddl.auto">update</property>