-->
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: Cant add my own helpers to the TemplateHelper
PostPosted: Sun Mar 19, 2006 2:40 pm 
Newbie

Joined: Sat Mar 04, 2006 11:28 am
Posts: 13
Location: Portugal
Hibernate version:
3.1.0 Beta 4

Name and version of the database you are using:
Oracle XE 10.2.0.1.0

Debug level Hibernate log excerpt:
Code:
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2hbmxml (Generates a set of hbm.xml files)

BUILD FAILED
F:\Programming\Java\workspace\DelegateItProject\hibernateReverseEngeneering\build.xml:38: org.hibernate.tool.hbm2x.ExporterException: Exception when instantiating tool hibernatetool.hbm2x.stringUtils.toolclass with org.hibernate.tool.hbm2x.StringUtils




What I am trying to do is add the StringUtils class to the Velocity templates.
I read this Issue:
http://opensource2.atlassian.com/projects/hibernate/browse/HBX-171

Here Max says to set a property with the given utility class.
Like...

hibernatetool.hbm2x.myTool.toolclass = mypackage.MyTool

In the Hibernate Docs I found a diferent sintax...

<property key="sometool.toolclass" value="x.y.z.NameOfToolClass"/>

Neither of them work.
The later gives no error but does nothing. The first gives the upper error.


Here's my ANT script snippet...
Code:
      <hibernatetool destdir="${build.classes.dir}"
                    templatepath="${template.dir}">
         <jdbcconfiguration configurationfile="hibernate.cfg.xml"
                        revengfile="hibernate.reveng.xml"
                        packagename="com.teamware.delegateit.model"/>
         <property key="jdk5" value="true"/>
         <property key="ejb3" value="false"/>
         <property key="hibernatetool.hbm2x.stringUtils.toolclass"
                 value="org.hibernate.tool.hbm2x.StringUtils"/>
         
         <hbm2hbmxml destdir="${build.classes.dir}"/>
         <hbmtemplate destdir="${build.classes.dir}" templateprefix="pojo/"
                   template="templates/pojo/Pojo.vm"
                   filepattern="{package-name}/{class-name}.java"/>
      </hibernatetool>


And in my template I try to use:
$stringUtils.upperCase("sometext")

The class I'm trying to add to the template is inside the HibernateTools.jar, so why can't it find it?
Wrong sintax?
Didn't I get the instructions right?

Thanks in advance,[/code]

_________________
Pedro Viegas


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 11:04 am 
Newbie

Joined: Sat Mar 04, 2006 11:28 am
Posts: 13
Location: Portugal
Just to remebrer my request.
Anyone out there knows how to solve this?

_________________
Pedro Viegas


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.