-->
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.  [ 6 posts ] 
Author Message
 Post subject: Reverse Engineering
PostPosted: Tue Feb 14, 2006 10:28 am 
Regular
Regular

Joined: Sun Feb 12, 2006 10:18 pm
Posts: 60
Location: Rosario, Argentina
Is it possible to do reverse Engineering from a database schema to Classes and (most important) hbm.xml files? I know it can be done with Hibernate, but as I use .NET, it really help to have a way to automatically write the mapping files...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 14, 2006 11:24 am 
Expert
Expert

Joined: Fri Oct 28, 2005 5:38 pm
Posts: 390
Location: Cedarburg, WI
There are several tools/scripts to do this. One place to start is by looking at K-Dub's script for MyGeneration (go to MyGeneration's web site). We started out with that one, although we had to essentially rewrite it after making so many mods. Still, it is a good place to start out.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 14, 2006 11:30 am 
Newbie

Joined: Wed Dec 21, 2005 6:17 am
Posts: 10
My favorite is Codus - http://www.adapdev.com/codus/

It is simple and easy to control! I took the beta-version (v1.3.0.0 beta) which you can download from the page... worked well for me! :) It also generates you all the needed classes with easy access-methods and so on... for all the features have a look at the documentation! :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 14, 2006 4:35 pm 
Regular
Regular

Joined: Sun Feb 12, 2006 10:18 pm
Posts: 60
Location: Rosario, Argentina
I downloaded and installed Codus... I might not have to program anything at all!!!


Top
 Profile  
 
 Post subject: ActiveRecord
PostPosted: Wed Feb 15, 2006 2:09 am 
Regular
Regular

Joined: Tue Jan 03, 2006 7:21 am
Posts: 85
Have you tried ActiveRecord from the Castle project http://www.castleproject.org/index.php/Main_Page

Using ActiveRecord you do not need to write XML mapping files but decorate your classes with attributes and ActiveRecord will do the rest, it uses NHibernate internally for persistence.

It also contains a ActiveRecordGenerator that can generate the attribute decorated classes for you from the DB.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 15, 2006 5:56 pm 
Regular
Regular

Joined: Sun Feb 12, 2006 10:18 pm
Posts: 60
Location: Rosario, Argentina
I asked earlier if there were tools for reverse engineering for NHibernate, and some people mentioned a few. One of them seemed particularly helpfull, "Codus", but it has the problem that it makes poor hbm.xml files, because it does not map one-to-many, many-to-one nor many-to-many collections. Besides that, it generated classes inside a class only as an id (instead of an actual object); ie: class "State" has as a variable an object of type class "Country". But Codus generates a class "State" with a property "IdCountry", because that's what there is in the database.
I tryed to do the same in Hibernate (the java version) with a plugin for Eclipse that I think cames with Hibernate, and it DID generate the class "State" with a class "Country" inside... so, the question is... is there a reverse engineering tool for NHibernate that works as the plugin for Eclipse?


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