-->
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.  [ 4 posts ] 
Author Message
 Post subject: problems when mapping recursive tree structure
PostPosted: Tue Sep 27, 2005 3:20 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 7:22 am
Posts: 21
Hibernate version: 3.1-beta3

Mapping documents:
<hibernate-mapping>
<class name="se.liu.studorg.blaskan.web.data.staff.Node">
<id name="id">
<generator class="native"/>
</id>

<list name="children"
inverse="true"
cascade="all-delete-orphan">

<key column="parent" not-null="true"/>
<list-index column="name"/>
<one-to-many class="Node"/>
</list>

<many-to-one name="parent"
class="Node"
not-null="false" />
<property name="name" />

</class>

</hibernate-mapping>

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

Full stack trace of any exception that occurs:
Association references unmapped class: Node
# org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2270)
# org.hibernate.cfg.HbmBinder.bindListSecondPass(HbmBinder.java:2121)
# org.hibernate.cfg.HbmBinder$ListSecondPass.secondPass(HbmBinder.java:2853)
# org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
# org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1005)
# org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:218)
# org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1120)
# net.sourceforge.hivetranse.transaction.hibernate3.SessionFactoryBuilderImpl.buildSessionFactory(SessionFactoryBuilderImpl.java:87)
# net.sourceforge.hivetranse.transaction.hibernate3.SessionProxyFactory.buildSessionFactory(SessionProxyFactory.java:155)
# net.sourceforge.hivetranse.transaction.hibernate3.SessionProxyFactory.createCoreServiceImplementation(SessionProxyFactory.java:100)
.
.
.

Name and version of the database you are using: mySQL 4.1

I can't get this simple tree structure to even create the schemas..
Isn't it possible to map recursively like this?
I remember seeing mappings like this, so I am pretty sure it works.

_________________
/ted


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 3:34 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Either add a package attribute to the hibernate-mapping element, and set it's value to "se.liu.studorg.blaskan.web.data.staff" , or fully qualify each and every 'Node' in the document.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 3:40 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 7:22 am
Posts: 21
Sorry about that stupid question.
I changed the class to "se.liu.studorg.blaskan.web.data.staff.Album", and now everything work fine.
sorry.

_________________
/ted


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 3:47 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
don't apologize. everyone has looked stupid on the forum at one point or another ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.