-->
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.  [ 3 posts ] 
Author Message
 Post subject: Roundtrip Engineering
PostPosted: Fri Mar 25, 2005 7:22 pm 
Senior
Senior

Joined: Fri May 14, 2004 9:37 am
Posts: 122
Location: Cologne, Germany
Hi there,

I'm actually working on a Project where we want to use Hibernate Pojos and Hibernate 2.1.8 for Persistence, also Java 5.0 and JBoss 4.01. I'm ordered to do that with Roundtrip Enigneering within Ant (also a requirement) which is normally no problem with Hibernate. Because we got an existing DB I used Middlegen from generating the Mappings with XDoclet Tags, hbm2java for the Pojos (XDoclet for Pojos to hbm) and SchemaExport and Update for the SQL stuff and some graphical Tools editing the Database Schema on the fly (Got about 100 Tables so xml Moddeling isn't so handy). So far so good. Now my boss wants selfexplaining names for methods, because of the coding guidelines we are using (mainly the generated method name break KISS). eg The Row Parentid in a table (lets call it WWW --> wer wills wissen <-> who wants to know) has a constrainted to the same table. When generated the POJOS with HBM2JAVA I get getWWW for getting the Parent and getWWWs for getting the kids. Thought I got the chance to write a VM for it that does the trick, but then I encountered that I also have to touch the source of HibernateTools another possiblity was to change the VM of Middlegen and also touching the Source there, but the consequence there will be that on every new release of Middlegen or HibernateTools I have to check if the contribution isn't broken and will still work, being a NONO/NOGO (<-- I personally hate this expression sounds like to my ears like "Shut up fool") for my boss. Then I did a research of Roundtrip tools available. I found some but none supports Java 5.0, so no chance to use them without dropping Java 5.0 and all advantages of using the new features making code more readable.
Then I used JBoss IDE Preview jre 1.5 to generate the Mappings and POJOs from my point of view the generated names are better, namely getWWW for the parent and SetOfWWW (which is ok when adding the Javadoc for it, but I got the feeling that this argue isn't very convincing to my collegues ). Now the problem will be the Ant Task, Hibernate 3 RC1 (even if it can be used for Production, know I got rocket scientists as collegues) and the Pre Stage of JBoss IDE which will be the stronger arguements for not using these tools.
Perhaps some of you guys got an idea what would be best pratice.

thx in advanced and best regards


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 28, 2005 9:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
HIbernate final 3.0 is very very close. Tools v3.0 preview release 2 is also very close. It will have much improved Ant support. Obviously, the focus going forward will be on HIbernate 3.x and the related tools package. You will find a steady improvement in the tools support over a short period of time.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 29, 2005 3:16 pm 
Senior
Senior

Joined: Fri May 14, 2004 9:37 am
Posts: 122
Location: Cologne, Germany
Thx for the reply David,

I also found a workaround for the dilemma. Middlegen is abled to render flat mappings without having Set's or manytoones. So I decided to take this approach until 3.0 is in a state we might use for production (looking forward for EJB3 entity beans ;) ). For now we'll stay on on 2.x with the mappings not knowing about the db relations. That will be done with the rendered extended classes, so we can take advantage of generic typed Lists and selfexplaining method names. As a nice little side-effect the performance is improved. Before having flat mappings my testcase took between 21 - 23 sec (Querying > 7000 records and building the session factory), now I'm down to 12 - 14 sec (Same number of records, building the ArrayLists needed and the session factory).
And I know that your iterations for releases are really short (Release often isn't it ? ), so kept up this brillant work and quality you are delivering. (A bit fishing :)) )

_________________
regards

Olaf

vote if it helped


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