Hi Varun B Rao,
First of all, a warm welcome to CodeRanch!
Varun B Rao wrote:This is my first day learning hibernate and I am trying to create a table using hibernate 5. Iam getting the below error which seems to be because SchemaExport is deprecated in hibernate 5. Is there any other way I can create a table using hibernate 5? I browsed a bit and found that using hibernate.hbm2ddl.auto in hibernate.cfg.xml file can help but don't exactly know how to do it. Really need some help. My code as below.
Here you'll find a very concise tutorial to generate database schemas with JPA 2.1. Definitely worth reading as well.
Hope it helps!
Kind regards,
Roel
PS. Always use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒
UseCodeTags ⇐ for more information. Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers. Jeanne already added the code tags for you. See how much easier the code is to read?