-->
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.  [ 3 posts ] 
Author Message
 Post subject: parsing errors in hbm.xml file
PostPosted: Sun Dec 14, 2003 7:08 pm 
Newbie

Joined: Wed Dec 10, 2003 8:40 pm
Posts: 14
Location: Sydney
Hi

I keep getting the following error when parsing my mapping files

10:01:22,932 ERROR [XMLHelper] Error parsing XML: XML InputStream(24) Attribute "not-null" must be declared for element type "key".
10:01:22,934 ERROR [XMLHelper] Error parsing XML: XML InputStream(25) Attribute "not-null" must be declared for element type "many-to-many".

I have the "not-null" attribute set to true in the .hbm.xml file for this class, and i have tried different orderings but it doesn't seem to make any difference. I'm using 2.1 final, jboss-3.2.1 and mysql 4.0.13

<hibernate-mapping>

<class name="com.generator.dom.hibernate.Status" table="status" discriminator-value="stts" proxy="com.generator.dom.hibernate.Status">
<id name="id" column="statusid" type="long">
<generator class="native"/>
</id>

<property name="status" type="java.lang.String" not-null="true"/>

<set name="types" table="status_statustypex" inverse="true" lazy="true">
<key not-null="true" column="statusid"/>
<many-to-many not-null="true" column="typeid" class="com.generator.dom.hibernate.StatusType"/>
</set>
</class>

</hibernate-mapping>

Here is other side of the relationship:

<hibernate-mapping>

<class name="com.generator.dom.hibernate.StatusType" table="statustypes" discriminator-value="stty" proxy="com.generator.dom.hibernate.StatusType">
<id name="id" column="typeid" type="long">
<generator class="native"/>
</id>

<property name="type" type="java.lang.String" not-null="true"/>

<set name="status" table="status_statustypex" lazy="true">
<key not-null="true" column="typeid"/>
<many-to-many not-null="true" column="statusid" class="com.generator.dom.hibernate.Status"/>
</set>
</class>

</hibernate-mapping>

thanks in advance for any help

cheers
andy


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2003 8:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
There is no not-null attribute for <key> or <many-to-many>. Please refer to the DTD.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2003 9:15 pm 
Newbie

Joined: Wed Dec 10, 2003 8:40 pm
Posts: 14
Location: Sydney
thanks


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