Hibernate version:
2.1.3
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="de.gloegl.road2hibernate.Event" table="EVENTS">
<id name="id" column="uid" type="long">
<generator class="increment"/>
</id>
<property name="date" type="timestamp"/>
<property name="title" column="eventtitle"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
N/A
Full stack trace of any exception that occurs:
Name and version of the database you are using:
MySQL 4.x, but I am not there yet :-)
The generated SQL (show_sql=true):
N/A
I am trying middle-out development (hand-done XML mapping docs, generating code and schema from this) because it just makes sense to me right now. I am doing this all in eclipse 3.0 if it matters.
My project has a lib folder with hibernate, mysql and hibernate-ext directories, all with jars in them. My src folder has a mapping folder with the event.hbm.xml file listed above, and a properties folder with the hibernate.properties and log4j.properties files in it.
OK, so I am *this* close to getting hbm2java working with the really simple mapping doc shown above.
I am plugging along, changing an ant build.xml file I downloaded, and testing it out. I get an error about no appenders found and please init the log4j system, so I add the properties directory to my classpath in the ant build file and get the following error:
Buildfile: D:\Eclipse30\workspace\HibernateExample\build.xml
generate:
BUILD FAILED: D:\Eclipse30\workspace\HibernateExample\build.xml:23: D:\Eclipse30\workspace\HibernateExample\src\properties} not found.
Total time: 891 milliseconds
I'm looking right at the directory, and right at the properties files it contains.
Here's the build.xml file:
<project name="Try Hibernate" default="run" basedir=".">
<property name="src.home" value="${basedir}/src" />
<property name="lib.home" value="${basedir}/lib" />
<property name="generated.home" value="${basedir}/src" />
<property name="generate.force" value="true" />
<path id="lib.class.path">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
<!-- added to solve the log4j error, causing current one -->
<fileset dir="src/properties}">
<include name="**/*.properties" />
</fileset>
<pathelement location="." />
<pathelement location="generated" />
</path>
<target name="generate">
<java classname="net.sf.hibernate.tool.hbm2java.CodeGenerator" fork="true">
<arg value="src/mapping/event.hbm.xml" />
<classpath refid="lib.class.path" />
</java>
</target>
(... other targets removed to save eyestrain ...)
</project>
I KNOW this is a simple problem, but I am stuck anyway. Any help would be greatly appreciated.
--PK
_________________ --Pierce Krouse
|