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:
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.
- 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.
- 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".
- 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.
- 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.
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.
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:
Let's check it out how it's looking.
Persistent class
Mapping the 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...