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?
|