-->
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.  [ 3 posts ] 
Author Message
 Post subject: HibernateReverse Engineering
PostPosted: Fri Sep 26, 2008 4:11 am 
Newbie

Joined: Fri Sep 26, 2008 4:01 am
Posts: 10
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0

I successfully genrated Bean classes for DataBase tables.

But to control the generate DAO classes for the Bean classes .
Is there any template that we can specify abt the methouds to occur.

Also the Class name is appended with 'home'
as {TbaleName}Home.java in DAO classes.
I want it to be DAO.

And the session factoy is got from JNDI .. I prefer using Spring context




Top
 Profile  
 
 Post subject: Got it - Done ReverseEngineering
PostPosted: Fri Oct 03, 2008 4:22 am 
Newbie

Joined: Fri Sep 26, 2008 4:01 am
Posts: 10
<hbmtemplate > is the key.
All I did was edit the daohome.ftl file to generate DAO interface and DAO impl using Spring's hibernareDaoSupport


<target name="reveng.DAO" depends="reveng.pojos " description="produce Dao interface and Impl">
<hibernatetool destdir="${src.dir}" templatepath="${basedir}/template/dao">
<configuration>
<fileset dir="${src.dir}">
<include name="**/*.hbm.xml" />
</fileset>
</configuration>
<property key="ejb3" value="false" />
<property key="jdk5" value="true" />
<hbmtemplate template="dao_interface.ftl" filepattern="{package-ame}/{class-name}DAO.java" />
<hbmtemplate template="dao_impl.ftl" filepattern="{package-name}/{class-name}DAOImpl.java" />
</hibernatetool>
</target>


Top
 Profile  
 
 Post subject: Got it - Done ReverseEngineering
PostPosted: Fri Oct 03, 2008 4:27 am 
Newbie

Joined: Fri Sep 26, 2008 4:01 am
Posts: 10
<hbmtemplate > is the key.
All I did was edit the daohome.ftl file to generate DAO interface and DAO impl using Spring's hibernareDaoSupport


<target name="reveng.DAO" depends="reveng.pojos " description="produce Dao interface and Impl">
<hibernatetool destdir="${src.dir}" templatepath="${basedir}/template/dao">
<configuration>
<fileset dir="${src.dir}">
<include name="**/*.hbm.xml" />
</fileset>
</configuration>
<property key="ejb3" value="false" />
<property key="jdk5" value="true" />
<hbmtemplate template="dao_interface.ftl" filepattern="{package-ame}/{class-name}DAO.java" />
<hbmtemplate template="dao_impl.ftl" filepattern="{package-name}/{class-name}DAOImpl.java" />
</hibernatetool>
</target>
[/quote][/code]


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