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: recursive mappping error newbie
PostPosted: Wed Dec 20, 2006 6:18 am 
Newbie

Joined: Wed Dec 20, 2006 5:57 am
Posts: 2
Hi there I'm can't get the mapping file to load witha simple recursive bi-directional relationship, if I remove the mapping category loads, it will not load with the recursive mappping. Can some one give me a clue

cheers

WK

Hibernate version: 1.2 beta 2

Mapping documents:

<many-to-one name="ParentCategory" class="Website.DataAccess.Category" column="ParentId" cascade="none" />

<bag name="ChildCategory" table="tblCategory" cascade="save-update" inverse="true">
<key column="ParentId" />
<one-to-many class="Website.DataAccess.Category"/>
</bag>

Code between sessionFactory.openSession() and session.close():

public Category ParentCategory
{
get { return _ParentCategory; }
set { _ParentCategory = value; }
}

public IList ChildCategory
{
get { return _childCategories; }
set { _childCategories = value; }
}

Full stack trace of any exception that occurs:

can't load mapping file

Name and version of the database you are using: SQLserver 2000



Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 6:06 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Did you try an unidirectional mapping, category only knowing its parent for example?

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 2:25 am 
Newbie

Joined: Wed Dec 20, 2006 5:57 am
Posts: 2
Yeah I tried and it still broke


<many-to-one name="ParentCategory" class="Website.DataAccess.Category" column="ParentId" cascade="none" />


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.