-->
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: Polymorphic components
PostPosted: Tue Apr 20, 2004 2:12 pm 
Regular
Regular

Joined: Mon Apr 19, 2004 6:54 pm
Posts: 79
Hi,

I have the following

abstract class IPAddress {...}
class IPv4Address extends IPAddress {...}
class IPv6Address extends IPAddress {...}

then I have

class Device {
private IPAddress _ip;

...
public IPAddress getIPAddress() {
...
}
...
}

and I want to map the IPAddress as a component, is it possible with Hibernate to have inheritance in components.

Christophe


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 4:42 pm 
Newbie

Joined: Tue Oct 07, 2003 3:58 pm
Posts: 16
Location: Netherlands
I didn't manage to get it working

<component> declaration does require explicit type
if, in your case, you declare component as IPAddress, you will have InstantiationException as soon as Hibernate tries to instantiate component for you - it's an abstract class!


Top
 Profile  
 
 Post subject: Re: Polymorphic components
PostPosted: Wed Apr 21, 2004 4:47 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
croudet wrote:
is it possible with Hibernate to have inheritance in components.

No

_________________
Emmanuel


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.