-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: map one class to different tables
PostPosted: Sat Jan 06, 2007 10:06 pm 
Newbie

Joined: Sat Jan 06, 2007 9:55 pm
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

This is my problem
I have a enumerationType class that I want to map to different tables
i.e enumerationType class is a kind of template

public class EnumType{
private int id;
private String code;
private Date createdDate;
}
Now I have classes like say TourType,EmailType,Someother type i.e look xactly like EnumType but are persisted into different tables
so basically I want to create just one class one hbm.xml file and dynamically push it into the right table so mbe I have something that says that this is a TourType push it into the TourType table......

Is this even possible.The reason I ask is its pretty redundent for me to have a class and hbm.xml file for each one of these it would be much better to just have a template class and dynamically decide where to push the data into...
Regards
Subu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.