This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Object mapping at runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Object mapping at runtime" Watch "Object mapping at runtime" New topic
Author

Object mapping at runtime

Rahul Gourshettiwar
Greenhorn

Joined: Oct 09, 2008
Posts: 1
1] Scenario-1

We have a scenario where we will get logical name of the tables from which we have to decide which table we have to refer to fetch data. So in this case i dont want to go with the option of creating as many POJO/Domain classes for all the tables in the databse. Is there any way where creation of POJO and maintaing the respective mapping in Hibernate.

2] Scenario-2

Say we have multiple tables but the column names differs with the prefixes like
Table1- Column Name - CKCState
Table2- Column Name - PMCState
So is there any way where we can maintain single POJO class but column mapping will done at runtime in hibernate.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Object mapping at runtime
 
Similar Threads
Hibernate - Generated POJO code
Hibernate mapping of many-to-many relationship with a joining table
hibernate mapping problem
Hibernate POJOs -- association or no-association ?
Getting property / column names from mapping file