I am having tables created by a DBA. And I want to have entity classes for each table for further querying. Can any one suggest how to automatically create the entity classe
If you use JPA for persistence, you can use "JPA tools" provided by Eclipse to generate java entity class from tables.
Here is the tutorial
You can generate classes using Hibernate Tools. There are two ways to generate these classes which is called as Reverse Engineering and Code Generation[dead link] -
Here is a good tutorial on how to use Eclipse to generate the entity classes from an existing database.
Try this Complete example with code in this repository and there is a word-document inside src/document for reference.
You could have a look at Spring Roo. It has database reverse engineering. There exists an eclipse integration, so that you can do that from within eclipse.
You can try the Telosys code generator. It can help for this kind of job.
It allows to generate the Java (POJO) classes from any database with the basic templates and you can also create your own template (a Velocity file) to generate your DAO classes
For more information see http://www.telosys.org