Tuesday, November 07, 2006

J2EE:Creating POJOs from Database tables using Oracle Toplink feature

Maynot be a frequent requirement, but sometimes developers may need to create Plain Old Java Objects(POJOs) out of Database Tables.This can be easily created by using the Oracle Toplink feature available in JDeveloper.

1)-Create a new Application, say ToplinkResearch.
2)-Add a project to this Application, say ToplinkResearch.
3)-Click New->Business Components->select Toplink/JPA.
4)-It will ask for the Database connection and at the same time an offline database
schema it asks for to maintain in the middle-tier.(You can create at the same time
as well!!)
5)-Select the Table name from the List, just we select for an Entity Object.
6)-Thats all and the POJO is created and ready to be compiled.
7)-This class can be refactored to be used in any other project.
8)-Right click on the POJO class and select "New Sample Java Client.." and it will
create a sample Java client that uses this POJO(However, in JM8, this client class
gives runtime exception).


4 comments:

Anonymous said...

Highly descriptive post, I liked that a lot. Will there be a part 2?

dream marriage
Have a look at my web blog ; telegraph dating

Priya Anand said...

Nice post. Oracle is a relational database management system produced by oracle corporation. Nowadays most of the multinational companies used this oracle database for storing and managing their data's and programs. So learning Oracle Training in Chennai is one of the best idea to make a bright career.

mythily mythu said...

Greens Technology's the leading software Training & placement centre Chennai & ( Adyar)
apple-ios training in chennai

mythily mythu said...

nice.
informix training in chennai