- This topic has 22 replies, 9 voices, and was last updated 19 years ago by Riyad Kalla.
-
AuthorPosts
-
Riyad KallaMemberMarc,
Can I see how you DDL for your vip data table? Also posting your hbm.xml file for the VIPData object is helpful.
Marc SiramyMemberRight,
what do you mean by DLL ?This is my hbm.xml file:
<?xml version="1.0" encoding='UTF-8'?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <!-- DO NOT EDIT: This is a generated file that is synchronized --> <!-- by MyEclipse Hibernate tool integration. --> <!-- Created Thu Oct 20 01:13:25 CEST 2005 --> <hibernate-mapping package="com.nscorp.hibernate"> <class name="Vipdata" table="vipdata"> <id name="vipId" column="vip_id" type="java.lang.Integer"> <generator class="native"/> </id> <property name="vipName" column="vip_name" type="java.lang.String" /> <property name="vipTitle" column="vip_title" type="java.lang.String" /> </class> </hibernate-mapping>
Riyad KallaMemberI wanted to see the c reate table statement for your vipdata table. You likely won’t be able to post the entire statement as our forusm filter out SQL code to avoid exploits, so you might need to just copy and paste the column defs from out of the generate creation code.
dhiraj31MemberCan some one please help me wiht this problem I am struck here for 2 days and I am new to hibernate. I have seen that many people have posted this question but no has posted any solution.
thank you in advance
dhiraj31Member@dhiraj31 wrote:
I have the same problem
Could not compile the mapping document
duplicate import:Can some one please help me wiht this problem I am struck here for 2 days and I am new to hibernate. I have seen that many people have posted this question but no has posted any solution.
thank you in advance
Riyad KallaMemberdhiraj31,
Please tell us the information from MyEclipse > About > Configuration Summary menu, then paste your exception in heree along with your hibernate.cfg.xml file and your hbm.xml file of the offending class.
dennisrjohnMemberI too was having the same duplicate import problem. I noticed that it was occurring with very generically named classes like “Person” and that got me wondering.
After looking through the hibernate mappings documentation, I found a setting that is called auto-import, which searches the classloader for the class in the mapping file (ignoring package structures).
In the mapping file for your class, add auto-import=”false” as such:
<hibernate-mapping package=”com.test.db.hibernate” auto-import=”false”>
<class name=”Person” table=”PERSON”>
<id name=”personId” column=”PERSON_ID” type=”java.lang.Long”>
<generator class=”sequence”>
<param name=”sequence”>PERSON_ID</param>
</generator>
</id><property name=”firstName” column=”FIRST_NAME” type=”java.lang.String” not-null=”true” />
<property name=”lastName” column=”LAST_NAME” type=”java.lang.String” not-null=”true” /><set name=”scheduleItemSet” inverse=”true”>
<key column=”PERSON_ID”/>
<one-to-many class=”ScheduleItem”/>
</set>
</class></hibernate-mapping>
That’ll fix it. It did for me at least.
Riyad KallaMemberThank you for posting here dennis to help the other folks having this problem.
-
AuthorPosts