-->
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: What is wrong with hbm.xml file
PostPosted: Wed Jul 25, 2007 12:14 am 
Newbie

Joined: Thu Feb 01, 2007 1:57 am
Posts: 17
Location: Mumbai
Hi Friends,

I got this exception plz help me.
====================Exception===================
=============================================
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.ExceptionInInitializerError
at first.Hiberutil.<clinit>(Hiberutil.java:20)
at first.Main.addEmployee(Main.java:20)
at first.Main.main(Main.java:9)
Caused by: org.hibernate.MappingException: Association references unmapped class: EmployeeTask
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2344)
at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2618)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1012)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1168)
at first.Hiberutil.<clinit>(Hiberutil.java:15)
... 2 more
==================Employee.hbm.xml================
==============================================
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="first.Employee" table="Employee">
<id name="id" type="int">
<generator class="increment"/>
</id>
<set name="SET" inverse="true" cascade="save-update,delete">
<key column="empID"/>
<one-to-many class="EmployeeTask" />
</set>
<property name="name" type="string"/>
<property name="age" type="int"/>
<property name="empid" type="string"/>

</class>
</hibernate-mapping>
===============EmployeeTask.hbm.xml================
==============================================
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="first.EmployeeTask" table="EmployeeTask">
<id name="id" type="int">
<generator class="increment"/>
</id>
<property name="project" type="string"/>
<property name="device" type="string"/>
<property name="deadline" type="string"/>
<property name="status" type="string"/>
<many-to-one name="empID" property-ref = "empid" class="first.Employee" not-null="true" cascade="save-update,delete"/>
</class>
</hibernate-mapping>


Thanks in adv....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 12:21 am 
Newbie

Joined: Thu Feb 01, 2007 1:57 am
Posts: 17
Location: Mumbai
Thanks Friends i solved my problem.


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.