-->
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: Inheritance structure for code generation
PostPosted: Tue Mar 21, 2006 9:50 am 
Newbie

Joined: Fri Jan 16, 2004 3:13 am
Posts: 4
Hi,

I've a question about inheritance in context of code generation.
I want to generate the annotated model classes as superclasses.
(code generation from an UML model as base)
e.g.

Generated superclass:

@Entity
@Table(name="USER")
public class UserAbstract implements java.io.Serializable {
...
}

These generated classes should act as superclasses for concrete classes which are implemented by hand.

Subclass:

public class User extends UserAbstract
..
}


Is this possible for the annotation model? When I annotate a superclass and use a subclass for persistence I get Exceptions when I try to persist the object with the EntityManager ==>

Exception in thread "main" java.lang.IllegalArgumentException: Unknown entity: User

It seems that the concrete instance has to be annotated.

Could anybody give me a hint how to solve such problems?


TIA

Martin


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 25, 2006 9:09 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
this is not possible

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 27, 2006 12:27 pm 
Newbie

Joined: Mon Dec 05, 2005 8:13 am
Posts: 9
@MappedSuperclass
public class UserAbstract implements java.io.Serializable {
...
}


@Entity
public class User extends UserAbstract
..
}


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.