-->
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.  [ 3 posts ] 
Author Message
 Post subject: Override table name in subclass
PostPosted: Tue Nov 27, 2007 11:48 am 
Newbie

Joined: Tue Nov 27, 2007 11:24 am
Posts: 3
Is it possible to override superclass's table name in subclass with hibernate annotations?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 03, 2007 9:24 am 
Beginner
Beginner

Joined: Sun Jul 31, 2005 6:15 pm
Posts: 28
Have a look there

http://www.hibernate.org/hib_docs/annot ... le/#d0e788

Don't you need a @MappedSuperclass in this situation ?

_________________
Michael Courcy


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 03, 2007 10:24 am 
Newbie

Joined: Tue Nov 27, 2007 11:24 am
Posts: 3
michaelcourcy wrote:
Have a look there

http://www.hibernate.org/hib_docs/annot ... le/#d0e788

Don't you need a @MappedSuperclass in this situation ?


MappedSuperclass does not help in my situation. I want to use two different session factories, each uses different database. There are some classes that should be used in both of them but mapped to different tables (For example class SomeClass should be mapped to Table1 in DB1 and to Table2 in DB2). SomeClass is the part of the existing API and I do not want to refactor it to have superclass.
Annotation mappings can be overridden through XML http://www.hibernate.org/hib_docs/annot ... iding.html
but I don't want to mix up xml and annotations.

The simplest approach here is to create copy of that class for different factories but I'd like to reuse the same class.


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

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.