Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1038717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:00:37+00:00 2026-05-16T15:00:37+00:00

So im trying to use Hibernate Tools to reverse engineer my database and I

  • 0

So im trying to use Hibernate Tools to reverse engineer my database and I am just getting into using Freemarker templates to weak the code it generates. The problem is I want to change the name of the DAO classes it generates. By default the DAO classes are named in the form PersonHome however to change the name to PersonDAO i modified the dao/daohome.ftl.

While this did change the generated class name to PersonDAO the java file was still called PersonHome.java.

Is there a place I can also change the generated file name to match the source code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:00:37+00:00Added an answer on May 16, 2026 at 3:00 pm

    Ok well I have got to the bottom of it myself. It seems while hibernate tools does support changing the filename the feature is not exposed in the Hibernate tools plugin for Eclipse which is frustrating. Instead I have had to create an ant build script to run the reverse engineering like follows.

    <project name="Reverse Engineer" basedir=".">
    
    <path id="toolslib">
     <path location="lib/hibernate3.jar" />
     <path location="lib/hibernate-tools.jar" />
     <path location="lib/freemarker.jar" />
     ...
     <path location="${jdbc.driver.jar}" />
    </path>
    
    
    <taskdef name="hibernatetool" 
             classname="org.hibernate.tool.ant.HibernateToolTask" 
             classpathref="toolslib" />
    
    
    <hibernatetool destdir="src">
       <jdbcconfiguration 
            configurationfile="src/hibernate.cfg.xml"
            packagename="my.package.name"
            revengfile="hibernate.reveng.xml">
       </jdbcconfiguration>
    
       <hbmtemplate destdir="src" 
            templatepath="templates"
            template="dao/daohome.ftl"
            filepattern="{package-name}/{class-name}DAO.java">
                <property key="ejb3" value="false" />
                <property key="jdk5" value="true" />
                <property key="sessionFactoryName" value="my.HibernateSessionFactory" />
            </hbmtemplate>
    
        </hibernatetool>
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to get Hibernate session inside a Hibernate Interceptor? I'm trying to use Hibernate
I'm trying to use Hibernate for the first time, and early on in the
I am trying to use T4 for source code generation. Mostly, I am able
I'm trying to use NHibernate for data access, and I have 2 simple entities
Trying to use an excpetion class which could provide location reference for XML parsing,
Trying to use a guid as a resource id in a rest url but
While trying to use LINQ to SQL I encountered several problems. I have table
I' trying to use a Linq query to find and set the selected value
I trying to use ImageInfo and Jython to get information from a image on
I'm trying to use svnmerge.py to merge some files. Under the hood it uses

Explore

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.