-->
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: CodeGenerator question
PostPosted: Fri Oct 03, 2003 3:03 pm 
Newbie

Joined: Fri Oct 03, 2003 2:55 pm
Posts: 1
Hello,
New to Hibernate and Open Source projects and I'm fiding this very interesting! Great job to all! I wanted to reverse engineer my hbm files to see if I had designed my class properly but I'm having a heck of a time getting code generator to run. It will be a very simple question for most of you but I don't have much experience running from the command prompt.

The instructions advise java -cp [hibernate_classpaths] net.sf.hibernate.tool.hbm2java.CodeGenerator [options] [mapping_files].

My (dumb) question is basically could someone give a real world example exactly what would go in those optional boxes. secondly, what position on the drive to you navigate to with command prompt before this would be run. I can't quite figure which Jar files will be necc. to run, also do I need to put anything in the environmental variables? It seems I need multiple jar files from multiple places. Also what is the format for the last variable, the mapping files, i.e. is it the whole path? Or should that file sit in the output directory?

Thanks in advance!

Jim


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 03, 2003 3:39 pm 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
I was right where you are, on Monday. Here is the bat file that I came up with, and just ran it (doesn't matter from where):
--------------------------------------------------------------------
set JDBC_DRIVER=%ORACLE_HOME%\jdbc\lib\classes12.zip
set HIBERNATE_HOME=c:\test\hibernate-2.0.3

set CORELIB=%HIBERNATE_HOME%\lib
set LIB=..\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%CORELIB%\commons-logging.jar;%CORELIB%\commons-collections.jar;%CORELIB%\commons-lang.jar;%CORELIB%\cglib.jar;%CORELIB%\dom4j.jar;%CORELIB%\odmg.jar;%CORELIB%\xml-apis.jar;%CORELIB%\xerces.jar;%CORELIB%\xalan.jar;%LIB%\jdom.jar;%LIB%\..\hibernate-tools.jar

java -cp %CP% net.sf.hibernate.tool.hbm2java.CodeGenerator -output=C:\test\java\ C:\test\*.xml
--------------------------------------------------------------------

Also, check this thread out for how to do this as an ant task along with middlegen:
http://forum.hibernate.org/viewtopic.php?t=924447

-Kat


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.