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.  [ 5 posts ] 
Author Message
 Post subject: Chapter 1 tutorial bug.
PostPosted: Thu Dec 15, 2005 12:08 pm 
Newbie

Joined: Thu Dec 15, 2005 12:01 pm
Posts: 2
Quote:
<class name="events.Person" table="PERSON">
<id name="id" column="PERSON_ID">
<generator class="native"/>
</id>
<property name="age"/>
<property name="firstname"/>
<property name="lastname"/>

<set name="events" table="PERSON_EVENT">
<key column="PERSON_ID"/>
<many-to-many column="EVENT_ID" class="Event"/>
</set>

</class>


because of the Person.hbm.xml JVM throws exception of unmapped class: Event. I over came this problem by changing class="events.Event" in the attributes of many-to-many tag.

I suppose this shall be fixed on the tutorial site.

regards


Top
 Profile  
 
 Post subject: Seems quite OK to ME
PostPosted: Thu Dec 15, 2005 12:43 pm 
Newbie

Joined: Sun Aug 07, 2005 3:55 am
Posts: 11
Location: slovakia
i guess it's Your hibernate.cfg.xml that is broken ... it seems You do not include both mappings, You should have smt like this (it seems to be OK in the first chapter of the reference to ME):
Code:
<mapping resource="events/Person.hbm.xml"/>
<mapping resource="events/Event.hbm.xml"/>


Yeah, You're right class="Event" should be with the package name class="events.Event" if the package is not imported, but that's not worth a word ...

good luck ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 15, 2005 12:58 pm 
Newbie

Joined: Thu Dec 15, 2005 12:01 pm
Posts: 2
Quote:
<mapping resource="events/Person.hbm.xml"/>
<mapping resource="events/Event.hbm.xml"/>


I got above tags in hibernate.hbm.xml . What do you mean importing Event? Where can I import events.Event to ignore class="Event" exception eventhough I declared that Event.hbm.xml in hibernate.hbm.xml?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 15, 2005 2:42 pm 
Newbie

Joined: Sun Aug 07, 2005 3:55 am
Posts: 11
Location: slovakia
no i mean simple if U "imported" the package events in the Event.hbml.xml e.g.: <hibernate-mapping package="events">


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 15, 2005 2:45 pm 
Newbie

Joined: Sun Aug 07, 2005 3:55 am
Posts: 11
Location: slovakia
just read the chapter 5 of the reference carefuly in You will understand the topic: http://www.hibernate.org/hib_docs/v3/re ... pping.html


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