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.
|