-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem with Ant task for generating dao and dao interface
PostPosted: Wed Jul 19, 2006 12:10 pm 
Newbie

Joined: Wed May 31, 2006 6:40 am
Posts: 19
Hibernate version:
3.2.0 cr2 ejb3 shipped with jboss 4.0.4 ga

Full stack trace of any exception that occurs:
[hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getJavaTypeName(org.hibernate.mapping.Property,boolean) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.ComponentPOJOClass(com.kirio.S3.ejb3.bean.LinguaId)
[hibernatetool] java.lang.NullPointerException


Ant task:

<!--
==========================================================================================
GENERATE DAO INTERFACE
==========================================================================================
-->

<target name="generateHibernateDaoInterfaceClasses">
<hibernatetool destdir="${generated.file.dir}/generated">
<jdbcconfiguration preferbasiccompositeids="true" configurationfile="${hibernateRootDir}/hibernate.cfg.xml" revengfile="${hibernateRootDir}/hibernate.reveng.xml" packagename="com.kirio.S3.ejb3.interfaces" />
<hbmtemplate filepattern="{package-name}/I{class-name}Home.java" templatepath="${hibernateRootDir}/template/dao" template="daointerfacehome.ftl">
<property key="jdk5" value="true" />
<property key="ejb3" value="true" />
</hbmtemplate>
</hibernatetool>
</target>
<!--
==========================================================================================
GENERATE DAO IMPLEMENTATION
==========================================================================================
-->

<target name="generateHibernateDaoImplClasses">
<hibernatetool destdir="${generated.file.dir}/generated">
<jdbcconfiguration packagename="com.kirio.S3.ejb3.bean" configurationfile="${hibernateRootDir}/hibernate.cfg.xml" revengfile="${hibernateRootDir}/hibernate.reveng.xml" />
<hbmtemplate filepattern="{package-name}/{class-name}Home.java" templatepath="${hibernateRootDir}/template/dao" template="daohome.ftl" >
<property key="jdk5" value="true" />
<property key="ejb3" value="true" />
</hbmtemplate>
</hibernatetool>
</target>


i try to generate custom dao & dao interface... but i have a table named Lingua with "complex" pk and so it generate pojo LinguaId.. but as u can see this break mi dao & dao interface... luckly seems that corresponding dao LinguaHome and dao interface ILinguaHome are generated correctly... how can i exclude LinguaId and other id files from my template generation???

thanks to all!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.