Thread:
 middlegen-hibernate-r2 
 Acco Lade   02 Apr 2004, 09:37 
 Re: middlegen-hibernate-r2 
 Acco Lade   02 Apr 2004, 09:39 
 Re: middlegen-hibernate-r2 
 kas   04 May 2004, 06:10 
 Re: middlegen-hibernate-r2 
 srirang   08 May 2004, 02:56 
 Re: middlegen-hibernate-r2 
 david   29 May 2004, 13:35 
 Re: middlegen-hibernate-r2 
 dfreire   22 Jun 2004, 20:25 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: kas (04 May 2004, 06:10) Replies: 3, Views: 38803
Subject: Re: middlegen-hibernate-r2
On 02 Apr 2004 09:39, Acco Lade wrote:

>On 02 Apr 2004 09:37, Acco Lade wrote:

>>I downloaded the package and ran it against a mysql database, and
>>well, how do I get my .java files? :-)

>>I do see my relationships and a bunch of .hbm.xml files, but nothing
>>else.

>>Did I miss something?

>>Thanks,
>>Acco

>Correction: I used version R4 and the latest xyz-11 JDBC connector
>from mysql.

One way to get it working is to:

1. add target hbm2java(I copied it from the Middlegen build.xml) to 
your build.xml.

2. modify target compile-hibernate by adding hbm2java to the depends 
(see below).

3. add any missing .jars from Middlegen.  To download Middlegen you 
can go to: http://sourceforge.net/project/showfiles.php?group_id=36044 
then unzip the files. I was in a rush so I copied the files in the 
Middlegen lib folder to your lib folder.  You may only need to add the 
hibernate jars ??

<!-- ============================================================= -->
<!-- Run hbm2java                                                  -->
<!-- ============================================================= -->
<target name="hbm2java" depends="middlegen" 
        description="Generate .java from .hbm files.">
  <taskdef
    name="hbm2java"
    classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
    classpathref="lib.class.path"
  />
		
  <hbm2java output="${build.gen-src.dir}">
  <fileset dir="${build.gen-src.dir}">
  <include name="**/*.hbm.xml"/>
  </fileset>
  </hbm2java>
</target>

---------------------------------------------------

<!-- ============================================================= -->
<!-- Compile business logic (hibernate)                            -->
<!-- ============================================================ -->
   <target name="compile-hibernate" depends="middlegen, hbm2java" 
           description="Compile hibernate Business Domain Model">
...
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]