Click here to Skip to main content
15,919,178 members
Articles / Database Development / SQL Server
Article

NHibernate Helper Kit

Rate me:
Please Sign up or sign in to vote.
3.59/5 (39 votes)
19 Aug 2006GPL32 min read 412.1K   5.7K   126   115
Here is a tool to help you build your NHibernate ORM applications.

Screenshot - figure6.gif

Introduction

Here is a tool for the use of your own applications that NHibernate. You can easily install and use this helper kit. To download, please click the link at the top of the page. If you are using NHibernate, you need to write a lot of persistent classes and XML mapping for each persistent class. Also, you need to write the NHibernate config file. At this point, using this tool, you can automatically create all these files in a few seconds.

Installing

After you download the installation files, unzip the file and open the folder. Then, you will see the following:

  • Setup.exe (shortcut): You can install the add-in via this installer.
  • Files (folder): All the needed files are here.

Open setup.exe and you will see the following interface:

Screenshot - figure1.gif

Click Run, and it will install itself; it will take a few seconds.

Using

After the installation, run Visual Studio 2005 and go to the Tools menu. You will see an add-in that is named Avva Mobile NHibernate Helper Kit BETA. There are four tab screens on the tool.

  1. Connection: This screen allows you to connect your database with connection parameters. It looks like the Visual Studio connection wizard. You need to set some parameters to connect to your database.
  2. Screenshot - figure2.gif

  3. Tables & Columns: This screen allows you to browse a selected database's tables and select them to create files. Also, if you want, you can see a table's column information by selecting from a table from a list and clicking "Preview Columns".
  4. Screenshot - figure3.gif

    Screenshot - figure4.gif

  5. Settings: This screen allows you to select some features, for example, copy the NHibernate DLL and use dynamic updates. Also, you have to select your project folder to configure the folders, namespaces, and assembly names.
  6. Screenshot - figure5.gif

  7. Generate: At the end of this, we can start the generate process. Just click Run and wait a few seconds. You can view all the process details in this section.
  8. Screenshot - figure6.gif

    After you've successfully completed the generating process, you can see the generated files in the project folder. If you selected "Copy NHibernate DLL to project" and other DLLs, the generator will copy it and create an NHibernate config file in your project's "bin" folder.

    Copies files to bin directory

    Also, the generator creates a folder named App_Code in your project folder to put persistent classes and mapping files in. It directly creates persistent classes to App_Code, and mapping files creates them in the NHMappings folder, as follows:

    App_Code folder for persistent classes

    NHMappings folder for mapping XML files

Let's check it out how it's looking.

Persistent class

Persistent class

Mapping the XML file

Mapping XML file

The next version will have...

  • VB.NET and C# language support
  • Table relationships
  • A sample using application blocks
  • Generic class implementation
  • And more according to your ideas, thoughts, and suggestions...

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Product Manager Doğan Online
Turkey Turkey
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralVery promising.. Pin
rosdi23-Feb-07 18:54
rosdi23-Feb-07 18:54 
QuestionNew version? Pin
WaYdotNET ( Carlo Bertini)7-Feb-07 4:30
WaYdotNET ( Carlo Bertini)7-Feb-07 4:30 
QuestionDoes it work in VS2005 Express ? Pin
calvin_cch9-Nov-06 10:30
calvin_cch9-Nov-06 10:30 
AnswerRe: Does it work in VS2005 Express ? Pin
fchicout1-Mar-07 13:31
fchicout1-Mar-07 13:31 
GeneralMissing Float Data Type Pin
Nicole_E9-Nov-06 4:44
Nicole_E9-Nov-06 4:44 
GeneralProblem with installation Pin
JO7529-Oct-06 22:08
JO7529-Oct-06 22:08 
GeneralCodeSmith, MyGeneration, dotnettiers, ... Pin
Los Guapos23-Oct-06 17:10
Los Guapos23-Oct-06 17:10 
GeneralRe: CodeSmith, MyGeneration, dotnettiers, ... Pin
Mark Pitman27-Apr-07 12:02
Mark Pitman27-Apr-07 12:02 
Sure there is. Maybe he didn't want to pay for a code generator. Maybe he found the free code generators difficult to use. Maybe he just wanted to learn about code generation and what better way than to write a code generator! Even if you use one of the available generators, it still takes time to learn it and write templates, etc. I wrote some code that uses the CodeDOM to generate some classes based off of database tables and it didn't take much more effort than figuring out how to write a template for one of the available code generators.

One thing I will say is that he should be using the CodeDOM to generate his code rather than writing out strings. That way he can generate VB or C# without having to maintain generators to do each.

Mark Pitman
"After three days without programming, life becomes meaningless." - The Tao of Programming

QuestionMySql Pin
marcdumon17-Oct-06 16:36
marcdumon17-Oct-06 16:36 
QuestionMySql Pin
marcdumon17-Oct-06 16:36
marcdumon17-Oct-06 16:36 
GeneralInstallations fails Pin
El Hondo23-Aug-06 6:25
El Hondo23-Aug-06 6:25 
GeneralRe: Installations fails Pin
Murat YILMAZ23-Aug-06 20:32
Murat YILMAZ23-Aug-06 20:32 
GeneralRe: Installations fails Pin
El Hondo23-Aug-06 23:07
El Hondo23-Aug-06 23:07 
GeneralRe: Installations fails Pin
Murat YILMAZ23-Aug-06 23:17
Murat YILMAZ23-Aug-06 23:17 
QuestionRe: Installations fails Pin
vince2331-Apr-07 10:02
vince2331-Apr-07 10:02 
GeneralRe: Installations fails Pin
Bhatia Gaurav16-May-07 2:45
Bhatia Gaurav16-May-07 2:45 
QuestionRe: Installations fails Pin
Bhatia Gaurav16-May-07 18:47
Bhatia Gaurav16-May-07 18:47 
QuestionVersion for Visual Studio 2003? Pin
hnim22-Aug-06 18:42
hnim22-Aug-06 18:42 
AnswerRe: Version for Visual Studio 2003? Pin
Murat YILMAZ22-Aug-06 20:29
Murat YILMAZ22-Aug-06 20:29 
GeneralIf you use NHibernate you should also see this Pin
Chris Micali22-Aug-06 17:09
Chris Micali22-Aug-06 17:09 
GeneralRe: If you use NHibernate you should also see this Pin
Murat YILMAZ22-Aug-06 20:32
Murat YILMAZ22-Aug-06 20:32 
GeneralError when running [modified] Pin
OblivionSY25-Jul-06 4:53
OblivionSY25-Jul-06 4:53 
GeneralRe: Error when running Pin
Murat YILMAZ26-Jul-06 19:50
Murat YILMAZ26-Jul-06 19:50 
Question:wtf: Next Release Pin
pvivera13-Jul-06 12:25
pvivera13-Jul-06 12:25 
AnswerRe: :wtf: Next Release Pin
Murat YILMAZ13-Jul-06 20:51
Murat YILMAZ13-Jul-06 20:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.