-->
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: Primary Keys and Inheritance
PostPosted: Fri Mar 24, 2006 5:20 pm 
Newbie

Joined: Fri Mar 24, 2006 5:10 pm
Posts: 7
I have a table that maps to a base object called JavaComponent that has an Id of componentId.

Extending this object is a table called ContentProcessor, which has a componentid and a configurationid.

I also need to load JavaComponents sometimes, and ContentProcessors. My JavaComponent looks like this:

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public class JavaComponent implements Serializable {
@Id
public Long getComponentId() {
return super.getId();
}
}

And the ContentProcessor looks like:

@Entity
public class ContentProcessor extends JavaComponent implements Serializable {
private Long configurationId = null;

@Id
public Long getConfigurationId() {
return configurationId;
}
}

I'd like for ContentProcessor to have both the componentid and configurationid as keys, but the runtime isn't allowing this. I've tried to override the getComponentId() to add this as an Id.

I get this:

Unable to define/override @Id(s) on a subclass: com.retrievers.model.bo.ContentProcessor

How do I get around this problem?


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

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Are you guys working for the same company?
http://forum.hibernate.org/viewtopic.php?p=2297800#2297800

_________________
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.