-->
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: How to mapping a one-to-one using same class inner??
PostPosted: Mon Apr 04, 2005 4:38 pm 
Newbie

Joined: Mon Apr 04, 2005 4:28 pm
Posts: 3
Location: São Paulo
Hibernate version:2.1

Mapping documents:

How can I do the mapping for the class below using one-to-one and not bi-direcional (or bi-direcional, wherever)??

public class Cat{
public Cat child;
public Integer id;
// get´s and set´s

}

Thanks in advance.

_________________
Thadeu de Russo e Carmo


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 12:14 pm 
Newbie

Joined: Tue Apr 05, 2005 8:01 am
Posts: 12
I dont think you can do such a thing (correct me if I am wrong), because according to hibernate you cant include the same column of the table twice in the hbm file. It will throw an exception.

More over according to your requirement its a never ending process, I mean a Cat is having one Cat and it has another and just goes on. Its a never ending process. I dont get your requirement.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 2:11 pm 
Newbie

Joined: Mon Apr 04, 2005 4:28 pm
Posts: 3
Location: São Paulo
I think that i was not clear.

Let me explain..

I have a class that it has an attribute that is a object like parent class.

If I map using one to many no problem.

Is it more clean??

_________________
Thadeu de Russo e Carmo


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.