-->
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: <version> and <timestamp> tags usage...
PostPosted: Sun Mar 06, 2005 10:46 am 
Newbie

Joined: Sun Mar 06, 2005 10:20 am
Posts: 7
According to Chapter 5 - 5.21 Using managed versioning, we can use <version> or <timestamp> tag to implement the application transaction.

But my problem is when i add the <version> or <timestamp> into my xml mapping file and run the application, exception occur.

The message are below :
Caused by: net.sf.hibernate.MappingException: invalid mapping
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:287)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
... 5 more

My xml mapping file:
<hibernate-mapping package="my.com.vsi.hibernate.bean">
<class name="Admin" table="admin">
<id name="id" column="ad_id" type="long" >
<generator class="native" />
</id>

<property name="userId" column="ad_userid" type="long" not-null="true"/>
<property name="code" column="ad_code" type="string" not-null="true"/>
<property name="password" column="ad_password" type="string" not-null="true"/>
<property name="name" column="ad_name" type="string" not-null="true"/>
<version name="version" column="ad_version" type="integer" />
</hibernate-mapping>

When I remove the <version> tag, the application can start smoothly.
So, I'm sure that the exception is cause by <version> tags.
Can somebody help me?
Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2005 11:01 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read the full exception message. According to the mapping DTD, version must be declared _before_ properties, you declared it after the properties.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2005 9:41 pm 
Newbie

Joined: Sun Mar 06, 2005 10:20 am
Posts: 7
Thanks a lot.


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.