-->
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.  [ 5 posts ] 
Author Message
 Post subject: How to tell hbm2java ant task to use config.xml file?
PostPosted: Sun Aug 01, 2004 4:26 am 
Newbie

Joined: Tue Jul 27, 2004 1:33 pm
Posts: 18
Location: South Africa
Hi there,

I am trying to customise the output of the hbm2java tool. I have found some info in chp15 of the tool quide which says to place configuration info used by hbm2java in a config.xml file.

My ant task looks like this

Code:
      <hbm2java output="${src.dir}" classpathref="hibernate.classpath">
         <fileset dir="${build.gen-src.dir}/">
            <include name="**/*.hbm.xml"/>
         </fileset>
      </hbm2java>



Nothing surprising there.

In my config.xml file I have

Code:
<codegen>
              <generate prefix="Base" renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/>
            <generate renderer="net.sf.hibernate.tool.hbm2java.VelocityRenderer">
                <param name="generate-empty-concrete-classes">true</param>
                <param name="baseclass-prefix">Base</param>
             <param name="template">pojomxc.vm</param>
              </generate>
</codegen>


How do I tell the ant taks to use this config file? I am pretty sure that I still need to debug the above config file as I don't fully understand how it all works but can't even get there because it is not used by the ant task. The config file is in the same directory as the hibernate.cfg.xml file and the hbm.xml files.


Another set of questions

The idea here is I want to create the default class genereated by the tool and use them as base classes for a the concrete class which I wish to override with some specific code. I need to implement comparable interface and extend another abstract class. I am trying to isolate my spefic code from the general code generated when the database changes.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 01, 2004 5:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
<hbm2java config="..." ...>

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 01, 2004 8:24 am 
Newbie

Joined: Tue Jul 27, 2004 1:33 pm
Posts: 18
Location: South Africa
thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 12, 2006 6:48 am 
Beginner
Beginner

Joined: Mon Jan 24, 2005 11:56 am
Posts: 24
Hi,

I get the error

Class org.hibernate.tool.ant.Hbm2JavaExporterTask doesn't support the "config" attribute.

Any comment!
I am using HibernateTools-3.1.0.beta4.zip

Regards,
Alireza Fattahi


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 12, 2006 11:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
why are you replying on a 2 year old answer related to hibernate 2 with a issue concerning hibernate 3 ?

_________________
Max
Don't forget to rate


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