-->
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.  [ 6 posts ] 
Author Message
 Post subject: Dao Generation - Expression clazz.hasNaturalId is undefined
PostPosted: Mon Nov 20, 2006 5:18 pm 
Newbie

Joined: Fri Nov 03, 2006 3:02 pm
Posts: 4
Location: Chennai, India
Hi All,

I am trying to Generate Dao Code using hibernate tools. I am getting the following exception.

[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processi
ng template dao/daohomebase.ftl
[hibernatetool] freemarker.core.InvalidReferenceException: Expression clazz.hasN
aturalId is undefined on line 200, column 6 in dao/daohomebase.ftl.

BUILD FAILED
C:\Documents and Settings\Fun\Desktop\Test\Code Generation\build.xml:86:
org.hibernate.tool.hbm2x.ExporterException: Error while processing template dao/
daohomebase.ftl
at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToo
lTask.java:211)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja
va:174)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: org.hibernate.tool.hbm2x.ExporterException: Error while processing te
mplate dao/daohomebase.ftl

This is my

<target name="GenerateDAO" depends="GenerateDAOBase">
<hibernatetool destdir="${build.dir}/generated">
<configuration configurationfile="hibernate.cfg.xml" />
<hbmtemplate
templateprefix="dao/"
template="dao/daohome.ftl"
filepattern="com/dao/{class-name}DAO.java">
<property key="jdk5" value="false" />
<property key="ejb3" value="false" />
</hbmtemplate>
</hibernatetool>
</target>

_________________
Thanks & Regards,
Arul.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 20, 2006 8:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
are you sure you are using a hibernate 3.2. jar ? use the jar that comes with the tools to make sure they are compatible.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 22, 2006 11:43 am 
Newbie

Joined: Fri Nov 03, 2006 3:02 pm
Posts: 4
Location: Chennai, India
Thanks for your reply.

I am using the same Hibernate jar that are coming with hibernate tools. Any thing else that i could be missing?

Thanks in Advance.

Regards,
Arul.

_________________
Thanks & Regards,
Arul.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 22, 2006 12:01 pm 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
Is it a component mapping? Please post the mapping file you think it is failing on.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 04, 2006 3:31 pm 
Newbie

Joined: Fri Nov 03, 2006 3:02 pm
Posts: 4
Location: Chennai, India
Thanks for your Reply.
Still i am not able to generate the Code. Please find the my Mapping xml.

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Dec 4, 2006 1:58:56 PM by Hibernate Tools 3.2.0.beta8 -->
<hibernate-mapping>
<class name="dto.holidaysched" table="HOLIDAYSCHED">
<comment></comment>
<compo-id name="id" class="dto.holidayschedId">
<key-property name="holidaydt" type="date">
<column name="HOLIDAYDT" length="10" />
</key-property>
<key-property name="processingcd" type="java.lang.Integer">
<column name="PROCESSINGCD" />
</key-property>
</compo-id>
<property name="codeshortnm" type="string">
<column name="CODESHORTNM" length="30">
<comment></comment>
</column>
</property>
<property name="codedscr" type="string">
<column name="CODEDSCR" length="80">
<comment></comment>
</column>
</property>
</class>
</hibernate-mapping>

Thanks in Advance.

_________________
Thanks & Regards,
Arul.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 4:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that is not a valid hbm mapping.

_________________
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.  [ 6 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.