-->
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.  [ 4 posts ] 
Author Message
 Post subject: generate DAO objects with ant
PostPosted: Thu Jun 01, 2006 12:10 pm 
Newbie

Joined: Mon Apr 11, 2005 6:59 am
Posts: 11
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.3

Name and version of the database you are using: Oracle 9.2.0.5

Hibernate Tools version: 3.1 beta 5

Hi,

In the daohome.ftl template I changed ${pojo.getDeclarationName()}Home.class by ${pojo.getDeclarationName()}DAO.class and work fine. But the name of the DAO class is ${pojo.getDeclarationName()}Home.class, Why? How I can change the classe name for ${pojo.getDeclarationName()}DAO.class?

Thanks.

Sory my poor english.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 01, 2006 2:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
via filepattern.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 05, 2006 4:52 am 
Newbie

Joined: Mon Apr 11, 2005 6:59 am
Posts: 11
max wrote:
via filepattern.


Hi Max,
I used this code
<hbmtemplate
filepattern="{package-name}/{class-name}DAO.java"
templatepath="${root.dir}/templates"
template="daohome.ftl"
exporterclass="org.hibernate.tool.hbm2x.DAOExporter"
destdir="${hibernateGenerated.dir}/dao">
<property key="jdk5" value="false"/>
<property key="ejb3" value="false"/>
</hbmtemplate>

and I changed the template (daohome.ftl)
public class ${declarationName}DAO {

When I run the ant script, NameDAO is the class name but the file name is NameHome.java

I donĀ“t understand what is wrong.

Thanks for any help.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 05, 2006 5:11 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
dont use any Exporter here - just skip the exporterclass name.

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