-->
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: Annotations inheritance question
PostPosted: Tue Mar 08, 2005 1:45 pm 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
If I have this:

@ManyToOne(cascade={CascadeType.CREATE})
@JoinColumn(name="theme", nullable=false)
public Theme getTheme()

in my superclass and

@ManyToOne(targetEntity="DefaultTheme")
public Theme getTheme()

in my subclass, will Annotations support be smart enough to merge the subclass annotations into

@ManyToOne(cascade={CascadeType.CREATE}, targetEntity="DefaultTheme")
@JoinColumn(name="theme", nullable=false)
public Theme getTheme()

or will it discard all superclass annotations and only retain the targetEntity in the subclass? This sort of question also comes into play when the superclass has a @Transient() annotation on a superclass method and say you decide that the subclass should persist it. How would one "remove" the @Transient annotation on the subclass?

Thanks,
Gili


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 9:40 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
The smart thing will not be done.
About inheritance overriding, we're still having some discussion in the EG.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 12:41 pm 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
emmanuel wrote:
The smart thing will not be done.
About inheritance overriding, we're still having some discussion in the EG.


Just wanted to note that I read somewhere that normal annotations can never be inherited. I think they are implementation-specific modifiers like the keyword "final" and only apply to the class they directly get applied to. Anyway, I will wait on updates from EG.

Thank you,
Gili


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.