-->
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.  [ 2 posts ] 
Author Message
 Post subject: @Table annotation within inheritance-hierarchie
PostPosted: Thu Aug 09, 2007 11:20 am 
Regular
Regular

Joined: Sat May 20, 2006 3:49 am
Posts: 78
Hi!

I have the problem that the following annotated class-code doesn't work. I would like to have one class generated from Hibernate-Tools, and one extended class for my own extra-class-code. Here is the code:

Code:
/**
* AppUserEntity generated by hbm2java
*/
@MappedSuperclass
@Table(name = "APP_USER", uniqueConstraints = @UniqueConstraint(columnNames = {
      "CODE_TYPE", "CODE_ID" }))
public abstract class AppUserEntity extends Base implements
   java.io.Serializable {

   protected String codeType;
...
}

/**
* My own class for extra-class-code.
*
*/
@Entity
public class AppUser extends AppUserEntity {

   private static final long serialVersionUID = 1L;
...
}


If I move the @Table property to the AppUser-class, it works. Without that, Hibernate uses "AppUser" instead of "APP_USER" for the table-name in the queries.

I know that Hibernate takes the table-name from the top of the inheritance-hierarchie, but is it somehow possible to leave all annotations in the super-class?

Regards,
Chr.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 8:27 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
No you can't do that

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.