-->
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: Reverse engineer or start fresh ?
PostPosted: Fri Sep 01, 2006 1:53 pm 
Beginner
Beginner

Joined: Fri Apr 15, 2005 3:30 pm
Posts: 46
Location: Fortaleza, Brazil
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.2cr3

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
sql server 9.0

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

Hi all,

I searched the forums, my hibernate books, googled and didn't turn up much. Please just link me somewhere if I'm asking something obvious.

I'm taking over the hibernate part of a new app. The current DB is _not_ production , and the only current hibernate code was auto-generated but was never used. The person who created the DB has given me the green light to basically try and re-create the DB using an Object first, hbm.xml approach. I've always worked with Hibernate starting with the objects and xml files first.

I'd like to justify the extra work before blindly coding. Can anyone explain why it would be better to start new since we have a choice, rather than continue with a reverse engineered config ?

Thanks!
Robert


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 01, 2006 9:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You can start from scratch so approach it the way you feel most comfortable with.
Personnally, I tend to start with the POJOs (Xdoclet/Annotations) though for small projects, reverse engineering followed by code generation works well.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 5:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
a reverse engineered config always need (more or less) tuning, so no matter what choice you take you need to go through the mapping and evaluate if the reverse engineered result is what you actually want.

Then if you have some good hbm.xml's auto-generating the java code is fine (since they would be exactly as what the hbm.xml's are describing)

And no matter what direction you take (topdown, bottomup, middleout) always consider what you want to represent in the objects world AND what you want to represent in the db world...both have merit.

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