Search code examples
java.netormentitypojo

How to generate entity classes from database in java


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.

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.

In java, on the other hand, I have to manually map all the tables and their fields.


Solution

  • Is this something you are looking for?

    http://www.wikihow.com/Generate-Hibernate-Pojo-Classes-from-DB-Tables