For some reason, schemaupdate doesn't seem to like the "timestamp" attribute in the xbm.xml file. What am I doing wrong?
Hibernate version: 3.1
Mapping documents:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
>
<class
name="wintox.audit.user.UserLoginAudit"
table="myapp_userloginaudit"
>
<id
name="id"
column="id"
type="long"
unsaved-value="-1"
>
<generator class="native">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-UserLoginAudit.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>
<property
name="username"
type="java.lang.String"
update="true"
insert="true"
column="username"
length="25"
/>
<property
name="workstationId"
type="java.lang.String"
update="true"
insert="true"
column="workstationId"
length="254"
/>
<property
name="timestamp"
type="java.util.Date"
update="true"
insert="true"
column="timestamp"
/>
<property
name="isSuccessful"
type="java.lang.Boolean"
update="true"
insert="true"
column="isSuccessful"
/>
<timestamp name="timestamp" column="timestamp"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():N/A
Full stack trace of any exception that occurs:Code:
[schemaupdate] org.hibernate.MappingException: invalid mapping
[schemaupdate] at org.hibernate.cfg.Configuration.addFile(Configuration.java:227)
[schemaupdate] at org.hibernate.tool.hbm2ddl.SchemaUpdateTask.getConfiguration(SchemaUpdateTask.java:155)
[schemaupdate] at org.hibernate.tool.hbm2ddl.SchemaUpdateTask.execute(SchemaUpdateTask.java:102)
[schemaupdate] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[schemaupdate] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaupdate] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaupdate] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaupdate] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[schemaupdate] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[schemaupdate] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[schemaupdate] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[schemaupdate] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[schemaupdate] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[schemaupdate] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[schemaupdate] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
[schemaupdate] Caused by: org.xml.sax.SAXParseException: The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,(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|query-list)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*)".
[schemaupdate] at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
[schemaupdate] at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
[schemaupdate] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
[schemaupdate] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
[schemaupdate] at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
[schemaupdate] at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
[schemaupdate] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
[schemaupdate] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
[schemaupdate] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[schemaupdate] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[schemaupdate] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[schemaupdate] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[schemaupdate] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[schemaupdate] at org.dom4j.io.SAXReader.read(SAXReader.java:465)
[schemaupdate] at org.dom4j.io.SAXReader.read(SAXReader.java:264)
[schemaupdate] at org.hibernate.cfg.Configuration.addFile(Configuration.java:226)
[schemaupdate] ... 14 more
Name and version of the database you are using:
SQL Server 2000 SP4
The generated SQL (show_sql=true):
N/A
Debug level Hibernate log excerpt:
N/A