title: How to generate entity classes from database in java
body: <p>I have been used to generating entity classes from database in .net. But recently i begun work on java and I have been looking for ways to do the same with hibernate or any other ORM tool. I havent yet found a way to do the same, all I find is that generate xml mappings or use java annotations.</p>
  
  <p>Am i missing something here, it used to be a very easy approach in .net. You figure out your data model, create a database and then generate the entity classes using Entity Framework. It took care of generating classes for foreign key mappings as well.</p>
  
  <p>In java, on the other hand, I have to manually map all the tables and their fields. </p>