-->
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.  [ 2 posts ] 
Author Message
 Post subject: SchemaExport tool -- which hibernate jars needed?
PostPosted: Mon Feb 09, 2004 2:03 pm 
Newbie

Joined: Mon Feb 09, 2004 1:45 pm
Posts: 8
I am trying to incoporate the SchemaExport tool into an ant build script. I'm working with jdk1.4.2, ant 1.6, and MySQL 4.0. I did read the FAQ and some of the manual, but I just can't seem to get this to work.

I have a project structure like so:

testroot/build.xml
testroot/src/hibernate.properties
testroot/src/test.hbm.xml
testroot/lib/hibernate2.xml
testroot/lib/mysql-jdbc-driver.jar

Well, I was reading Ch. 19 of the hibernate manual regarding the toolset. I came across an example of how to incorporate the SchemaExport utility into an Ant file. It looks something like this:

<target name="schemaupdate">
<taskdef name="schemaupdate"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaUpdateTask"
classpathref="${class.path}"/>

<schemaupdate
properties="${hibernate.properties}"
quiet="no">
<fileset dir="src">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaupdate>
</target>

I have the hibernate.properties file configured for MySQL. I believe my test.hbm.xml is in the right place under src/. However, I am having a terrible time setting my class.path property. I realize my problem may be a simple java environment problem, but I am looking for a sanity check here. No matter what I set the class.path property to I get some kind of "not found" error in the dos prompt when I run "ant schemaexport".

I've tried setting class.path to:

c:/testroot/lib
c:/testroot/lib/
c:/testroot/lib/*.jar

as well as

c:/hibernate-2.1/lib
c:/hibernate-2.1/lib/
c:/hibernate-2.1/lib/*.jar

So my questions are:

1) Do I need to include more than just the hibernate2.jar and my jdbc driver jar file in my project's lib directory?

2) Is my syntax wrong for the classpathref attribute?

Thanks in advance for any help.

Dan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2004 2:14 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You need the compiled persistent class files and all 3rd party libraries required by Hibernate (lib/README.txt). Check the Toolset Workshop on the website and use it as a skeleton.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.