-->
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: Several questions on the code generator
PostPosted: Tue May 26, 2009 11:15 am 
Newbie

Joined: Tue May 26, 2009 11:04 am
Posts: 2
Hi,

I just downloaded the jboss tools which include the Hibernate Code Generator and now I have a few questions.

1. If I use "reverse engineer from JDBC", it overwrites all of my code? Does that mean I can do it only once and after that I will have to add any DB Schema changes by hand?

2. How can I define that I want to have different packages for each exporter? I want all the DAO go into mypackage.data and the domain code into mypackage.data.whatever. I tried to define different output directories, but then the "import" statements are missing and I have to correct every file by hand.

Thanks,

Arne


Top
 Profile  
 
 Post subject: Re: Several questions on the code generator
PostPosted: Thu May 28, 2009 4:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Arnee wrote:
Hi,
1. If I use "reverse engineer from JDBC", it overwrites all of my code? Does that mean I can do it only once and after that I will have to add any DB Schema changes by hand?


For entities you can use the <meta attribute="generated-class"> to tell the tooling to generate a base class for those classes you want to add custom code to.

In the current version we are looking at using jmerge to make this easier.

Quote:
2. How can I define that I want to have different packages for each exporter? I want all the DAO go into mypackage.data and the domain code into mypackage.data.whatever. I tried to define different output directories, but then the "import" statements are missing and I have to correct every file by hand.


The DAO templates doesnt support this very well :(

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Several questions on the code generator
PostPosted: Thu May 28, 2009 11:10 am 
Newbie

Joined: Tue May 26, 2009 11:04 am
Posts: 2
Hi max,

Thanks for your reply. Since I'm quite new all the Java / Hibernate / Spring development I'm still reading a lot of tutorials and so on. Looks like together with Spring you don't need most of the code anyway anymore :-)

Greets,

Arne


Top
 Profile  
 
 Post subject: Re: Several questions on the code generator
PostPosted: Sat Jun 06, 2009 1:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well, if you notice the code in the dao's doesn't do much else than call into the hibernate session API so with just bare bones Hibernate you don't need much of this code.

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