-->
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: SAXParseException: Attribute "column" must be decl
PostPosted: Mon Oct 27, 2003 1:48 pm 
Newbie

Joined: Mon Sep 08, 2003 4:04 pm
Posts: 8
Location: San Diego, CA
I'm getting a few weird SAXParseExceptions like these when initializing hibernate:
Code:
org.xml.sax.SAXParseException: Attribute "column" must be declared for element type "one-to-one".
org.xml.sax.SAXParseException: Attribute "insert" must be declared for element type "one-to-one".
org.xml.sax.SAXParseException: Attribute "update" must be declared for element type "one-to-one".

My mapping looks like this:
Code:
<class name="drees.Account" table="account">
   <id name="customerId" column="customer_id" type="long">
      <generator class="assigned"/>
   </id>
   <property name="acctNumber" column="acct_number" type="string" not-null="true"/>
</class>
<class name="drees.Customer" table="customer">
   <id name="customerId" column="customer_id" type="long">
      <generator class="identity"/>
   </id>
   <one-to-one name="account"
               column="customer_id"
               insert="false"
               update="false"
               class="drees.Account"
               />
</class>

Obviously the column, insert and update attributes are set. Any ideas?

Using Hibernate 2.0.3, Java 1.4.2.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 27, 2003 2:54 pm 
Regular
Regular

Joined: Tue Aug 26, 2003 7:53 pm
Posts: 66
Location: Lakeland, Florida USA
Are you sure that column, insert & update are valid attributes of the one-to-one element? Look at the DTD.

Jeff


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 27, 2003 5:50 pm 
Newbie

Joined: Mon Sep 08, 2003 4:04 pm
Posts: 8
Location: San Diego, CA
Thanks for getting me to look at the DTD in detail. Turns out the error message should really means "you've got an extra attribute in your element" not "you're missing a required attribute" like I thought it did.


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.