-->
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.  [ 5 posts ] 
Author Message
 Post subject: Using the <version> | <timestamp> tag generates
PostPosted: Fri Oct 27, 2006 3:31 pm 
Newbie

Joined: Sat Jul 29, 2006 4:51 am
Posts: 11
Guys,

When I try to use the version and/or timestamp tags in my class mappings I get XML Validation errors. (See inline xml doc)

Code:
<?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 package="net.nowehere.impl.dbo.core" auto-import="false">
   <class name="AddressImpl" table="std_address_information_cust">
      <id name="id" type="integer" column="ai_id">
         <generator class="identity" />
      </id>
      
      <properties name="ai_address_constraint" unique="true" insert="true" update="true">
         <property name="building" type="string" column="ai_building" not-null="true" length="32" />
         <property name="street" type="string" column="ai_street" not-null="true" length="32" />
         <property name="town" type="string" column="ai_town" not-null="false" length="32" />
         <property name="county" type="string" column="ai_county" not-null="false" length="32" />
         <property name="city" type="string" column="ai_city" not-null="true" length="64" />
         <property name="country" type="string" column="ai_country" not-null="true" length="64" />
         <property name="zipCode" type="string" column="ai_zipcode" not-null="true" length="16" />
      </properties>
      
      <version name="version" column="ai_version" type="long" />
   </class>
</hibernate-mapping>


The error i get from this doc is:

Code:
Content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)"


I followed the hibernate 3 documentation and specifications to the letter can anyone tell me why this validation error is occuring? If i comment out the version line it validates just fine. I am wondering if there is a flaw in the DTD document?

Any help is appreciated!

Thanks,

Nathan Klick


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 4:02 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
I've never used that <properties> tag, see if that's causing the problem.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject: Already ruled out <properties>
PostPosted: Fri Oct 27, 2006 6:58 pm 
Newbie

Joined: Sat Jul 29, 2006 4:51 am
Posts: 11
Guys,

I have already ruled out the <properties> tag, the issue occurs whether or not it is included in the mapping file.

Any other thoughts or suggestions?

-----------------
Nathan


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 7:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
read the dtd, version has to come before any property tag.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Thanks Max!
PostPosted: Fri Oct 27, 2006 7:18 pm 
Newbie

Joined: Sat Jul 29, 2006 4:51 am
Posts: 11
Max,

Thank you very much!

---------------------------------------
Nathan


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