-->
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.  [ 3 posts ] 
Author Message
 Post subject: [middlegen] java2hbm
PostPosted: Wed Jan 31, 2007 2:28 pm 
Newbie

Joined: Fri Nov 17, 2006 11:32 am
Posts: 13
Hi, I'm almost sure that this must be answered somewhere, but I can't find it so I apologise if this is a repetitive question and please tell me the link to the correct post before closing this one.
The question is simple: I have my .java files and I need to generate the .hbm with middlegen and xdoclet. Here is a way to do it but it's only for Hibernate 2. I tried to use it with H3.2GA, but I couldn't. Is there any way to do it?
Thanks
Neuquino

_________________
Neuquino
"Keep on trying and get better every day" (Queen)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 9:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Searching this forum should have shown many answers for this.
Anyway no problem.

Middlegen does have support for H3 but you need to build it from source.
I have never got around to doing an official (or unofficial) release.
You set the version attribute to "3.0" and use it as you have in the past.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 10:00 pm 
Newbie

Joined: Fri Nov 17, 2006 11:32 am
Posts: 13
thanks for your answer david. Finally, after a hard fight with xdoclet2, doclipse, myeclipse, hibernate, hibernate-anotations, etc I get it aparently working. I say aparently because the build.xml file works fine, but it doesn't generate a single .hbm
here is the build.xml
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<project name="XDOCLET XML" default="hibernatedoclet" basedir=".">
   <property name="src.home" value="${basedir}/../src" />
   <property name="lib.home" value="${basedir}/lib" />
   <property name="generated.home" value="${basedir}/src/xdoclet" />
   <property name="generate.force" value="true" />
   <path id="class.path">
      <!-- xdoclet2 -->
      <pathelement location="${lib.home}/xdoclet/xdoclet-2.0.4.jar" />
      <!-- Add the xdoclet2 plugins jar here -->
      <pathelement location="${lib.home}/xdoclet/xdoclet-plugin-hibernate-1.0.3.jar" />
      <!-- xdoclet2 runtime dependencies -->
      <pathelement location="${lib.home}/xdoclet/generama-1.2.1.jar" />
      <pathelement location="${lib.home}/xdoclet/picocontainer-1.0.jar" />
      <pathelement location="${lib.home}/xdoclet/nanocontainer-1.0-beta-3.jar" />
      <pathelement location="${lib.home}/xdoclet/nanocontainer-ant-1.0-beta-3.jar" />
      <pathelement location="${lib.home}/xdoclet/qdox-20051211.114207.jar" />
      <pathelement location="${lib.home}/xdoclet/velocity-1.4.jar" />
      <pathelement location="${lib.home}/xdoclet/commons-logging-1.0.4.jar" />
      <pathelement location="${lib.home}/xdoclet/commons-collections-3.1.jar" />
      <pathelement location="${lib.home}/xdoclet/commons-jelly-20050813.225330.jar" />
      <pathelement location="${lib.home}/xdoclet/commons-jelly-tags-define-1.0.jar" />
      <pathelement location="${lib.home}/xdoclet/commons-jelly-tags-jsl-1.0.jar" />
      <pathelement location="${lib.home}/cxdoclet/commons-jelly-tags-xml-20050823.222913.jar" />
      <pathelement location="${lib.home}/xdoclet/commons-logging-1.0.4.jar" />
      <pathelement location="${lib.home}/xdoclet/dom4j-1.6.jar" />
      <pathelement location="${lib.home}/xdoclet/commons-beanutils-1.7.0.jar" />
      <pathelement location="${lib.home}/xdoclet/commons-jexl-1.0.jar" />
   </path>
   <target name="hibernatedoclet" depends="" description="Generate Persistence and form classes">
      <taskdef name="xdoclet" classname="org.xdoclet.ant.XDocletTask" classpathref="class.path" />
      <xdoclet>
         <!-- defines the file handled by xdoclet2 -->
         <fileset dir="${src.home}">
            <include name="**/*.java" />
         </fileset>
         <!-- defines the processing of a plugin -->
         <component classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin" destdir="${generated.home}" version="3.0" />
      </xdoclet>
   </target>
</project>

Is anything missing? the output after ant's execution is:
Quote:
Buildfile: /home/neuquino/workspace/Editor/tools/build.xml
hibernatedoclet:
[xdoclet] Running org.xdoclet.plugin.hibernate.HibernateMappingPlugin
BUILD SUCCESSFUL
Total time: 1 second

Thanks again.
Greetings,
Neuquino

_________________
Neuquino
"Keep on trying and get better every day" (Queen)


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