-->
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.  [ 2 posts ] 
Author Message
 Post subject: changing names and packages in generated code
PostPosted: Tue Aug 24, 2010 11:45 pm 
Newbie

Joined: Tue Aug 24, 2010 11:30 pm
Posts: 1
I'm trying to use the Hibernate Tools in Eclipse to use a custom name for my DAOs and put my domain objects in a different location. Why? Well, I think "Home" is an odd suffix and would prefer "DAO". Not that this really matters, but I'd like to do it. As for the domain objects, I'm sharing them between different implementations (MyBatis and Hibernate). Even if I wasn't, I'd like to separate concerns. Domain objects are fundamentally different that data access objects, so putting them in separate directories doesn't seem all that weird to me.

As a specific example, let's say I've got a table called Student. What I want is the following:

com.mycomp.entities.Student
com.mycomp.model.hibernate.gen.StudentDAO

The daohome.ftl seems to assume that the domain object (Student) will be in the same directory as the DAO. I could certainly hack this and manually add the right include. I suppose I could live with that, but it would seem like there should be a more elegant way.

What I can't seem to hack around is the name of the class file generated by daohome.ftl. I can change the name of the class internally but not the actual name of the file.

Is there a way to handle this?


Top
 Profile  
 
 Post subject: Re: changing names and packages in generated code
PostPosted: Fri Sep 03, 2010 3:42 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
You probably should use 2 configuration first for DAO and sencond for Domain exporters.


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