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...
|