-->
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: Reverse engineering,using(slightly modified)custom templates
PostPosted: Fri Feb 01, 2008 6:26 am 
Newbie

Joined: Fri Feb 01, 2008 6:08 am
Posts: 2
Hibernate version:
Hibernate Tools 3.2.0.CR1

Mapping documents: et followings
omissis

Hi,
I would like to reverse engineering a db (no matter wich and which version) generating pojo, dao and hbm. This is easy :)

I would like NOT to have date changed every single time, beacause it can be really annoying when using versioning tools.

For dao generation I resolved this way: I mad dir Plugins, put inside dir dao and inside daohome.ftl (downloaded from the net); I then removed tag {date} from template and everything was fine.

I tried to do the same with hbm, making dir hbm, putting inside hibernate-mapping.hbm.ftl, then removing tag date. It actually did not write the date, but it generated almost empty HBMs, with just header inside. Then I got all the array, bag, column, component, filter-def, etc. .hbm.ftl stuff and put them in the hbm dir, leaving them unchanged. Nothing different: almost empty hbms.

So, what is the best (on simplicity-efficiency-flexibility axis) way to perform the following task: reverse engineering generic db obtaining pojo, hbm and dao files with slight changes from default result?

Thanks in advance

_________________
Better to reign in hell than serve in heaven


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 01, 2008 9:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
just only copy of the ftl files you need to change the rest will be picked up from the default location.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 01, 2008 1:39 pm 
Newbie

Joined: Fri Feb 01, 2008 6:08 am
Posts: 2
Thanks for your quick reply,

I tried to do that, but it did not work out, making only empty hbms, maybe I got the wrong ftl files? Could you please point me out where must I get them (both for hbm and pojos)?

_________________
Better to reign in hell than serve in heaven


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 01, 2008 1:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate-tools.jar/hbm/*.ftl

and

hibernate-tools.jar/pojo/*.ftl

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