-->
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: How can I create multiple 'instances' of an entity?
PostPosted: Fri Nov 23, 2007 5:57 am 
Newbie

Joined: Fri Oct 12, 2007 5:51 pm
Posts: 5
I would like to use an entity class within my application more than once but with each 'instance' write to a different table.

example (not the actual situation):

@Table(name = "Address")
public class Address

I would like to store multiple Address types in my Database each with their own table. I somehow have to change the table name for each instance. What is the best way to do this? Extend a base Address and add @Table to each extension? And what about DAO classes?

What is the best approach for this? With plain old JDBC you can just change the table name but I don;t know how to do this 'the right way' with Hibernate.


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.