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.  [ 1 post ] 
Author Message
 Post subject: Using natural-id inside subclass
PostPosted: Wed Jan 30, 2008 3:24 am 
Newbie

Joined: Wed Dec 26, 2007 4:24 am
Posts: 4
Hi all,
In my case, I have class A, with a member of class B that has member Long x. Also there is class C that extends A.
I would like to make the x member to be natural-id but only on C level.
The mapping is table per hierarchy.

Java
Code:
public class A{
private B b;
// getters / setters
}

public class B{
private Long x;
// getters / setters
}

public class C extends A{
// implemented equals and hashCode for natural id
}


mapping
Code:
<class name="A" discrimintaotr-value="a">
...
<component name b>
<property name="x"/>
</component>

<subclass name="B">
<natural-id>
<property name="b.x"/>
</natural-id>
</subclass>
</class>


but this gives a parsing error saying the natural-id not allowed in subclass element.

Anybody any suggestions?

Thanks,
Uri R.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.