-->
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: mapping object with same object type as attribute
PostPosted: Wed Dec 14, 2005 12:52 pm 
Newbie

Joined: Wed Dec 14, 2005 2:07 am
Posts: 3
Hi All

I have a class that contains an instance of itself as an attribute, for example...

Code:
public SpecialNumber
{
    Long id;
    SpecialNumber previousNumber;
}


There will only be a one-to-zero-or-one for this attribute. I was thinking that the previousNumber column would contain the id attribute of the Class that it references. My problem is that I'm not sure how this should be mapped using Hibernate. I've tried several things however the schemaexport task won't even create the column.

Can someone give me an idea how to handle this? I've searched the forum and the documentation and haven't seen anything like what I'm trying to do.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 15, 2005 1:16 pm 
Newbie

Joined: Wed Dec 14, 2005 2:07 am
Posts: 3
Never mind...I figured it out for myself. Thanks to all who helped. Wait a sec, oh yeah no one helped with this. No credits for you!!!


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.