-->
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.  [ 1 post ] 
Author Message
 Post subject: problem with mapping
PostPosted: Wed Apr 27, 2011 2:27 pm 
Newbie

Joined: Fri Aug 15, 2008 9:09 am
Posts: 12
Hi everyone,

I have created three tables as follow :

sh_company : company_id(PK),company_name

sh_user_info : user_id(pk),first_name,last_name,email_id,password,role,manager_email_id,company_id(FK references sh_company)

sh_thread: thread_id(PK),thread_subject,isInitiated,user_id(FK references sh_use_info),company_id(FK references sh_company)

following are respective hbm.xml file

user_info.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>

<class name="com.salaryhike.web.User" table="SH_user_info">
<id name="user_id" type="int" column="user_id" unsaved-value="0">
<generator class="increment"/>
</id>
<property name="first_name" type="string" column="first_name" />
<property name="last_name" type="string" column="last_name" />
<property name="email_id" type="string" column="email_id" />
<property name="manager_email_id" type="string" column="manager_email_id" />
<property name="role" type="string" column="role" />
<property name="password" type="string" column="password" />
<many-to-one name="company" class="com.salaryhike.web.Company" column="company_id" cascade="delete" ></many-to-one>
</class>

</hibernate-mapping>


company.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>

<class name="com.salaryhike.web.Company" table="SH_company">
<id name="company_id" type="int" column="company_id">
<generator class="increment"/>
</id>
<property name="company_name" type="string" column="company_name" />

</class>

</hibernate-mapping>


userThread.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>

<class name="com.salaryhike.web.UserThread" table="SH_thread">
<id name="thread_id" type="int" column="thread_id" unsaved-value="0">
<generator class="increment"/>
</id>
<property name="isInitiated" type="boolean" column="isInitiated" />
<property name="thread_subject" type="string" column="thread_subject" />
<many-to-one name="user_id" class="com.salaryhike.web.User" column="user_id" cascade="delete" ></many-to-one>
<many-to-one name="company_id" class="com.salaryhike.web.Company" column="company_id" cascade="delete" ></many-to-one>

</class>

</hibernate-mapping>


When I run my java code , it shows me error Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

Please help me out...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.