I finally found the time to create a simple test and my first observation was correct. For interest, I included the XML, the java task, and the resultant file below.
Thanks for the input.
XML file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name = "com.myTest.hibernate.Test" table="test">
<id name="id" type="int" column="id" unsaved-value="0">
<meta attribute="scope-set">protected</meta>
<meta attribute="field-description">prospects primary key</meta>
<generator class="sequence">
<param name="sequence">mmseq</param>
</generator>
</id>
<property name="test_field" column="test" type="java.sql.Date" not-null="true"></property>
</class>
</hibernate-mapping>
Ant Task used to build:
Code:
<taskdef name = "hbm2java"
classname = "net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
classpathref = "project.class.path"/>
<target name="codegen" description = "Generate Java source from the O/R mapping files">
<hbm2java output = "src">
<fileset dir = "src">
<include name = "**/*.hbm.xml"/>
</fileset>
</hbm2java>
</target>
And the resultant file (I only listed the top for brevity). Note that java.util.Date is imported, not java.util.SQL
Code:
package com.myTest.hibernate;
import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang.builder.ToStringBuilder;
/** @author Hibernate CodeGenerator */
public class Test implements Serializable {
/** identifier field */
private int id;
/** persistent field */
private Date test_field;
/** full constructor */
public Test(Date test_field) {
this.test_field = test_field;
}
/** default constructor */
public Test() {