NHibernate With Blackfish

by John 1/17/2009 3:08:00 AM

I've just started to explore NHibernate. About the first thing I noticed was that it didn't support Blackfish. I had taken the opportunity to download the source code. It was while I was doing some debugging I noticed the classes used for individual database support. With a few hours of investigation I was able to get a couple of classes up and running with Blackfish.

I have uploaded a project to CodeCentral, it consists of a very simple example, a Blackfish database and a couple of csharp files.

If you download the example you should find three directories. 

 

1) BlackfishSupport - which contains the 2 C# files that you need to add to the NHibernate solution

2) database - A sample database. 

3) NHibernateConsoleApplication - A very small example I developed using Delphi Prism.

So having downloaded the NHibernate source the first thing you need to do is add the 2 C# files . Assuming the source was at the following locationS

H:\develop\NHibernate-2.0.1.GA\src

BlackfishDialect.cs goes into H:\develop\NHibernate-2.0.1.GA\src\src\NHibernate\Dialect

and

BlackfishDriver.cs  goes into H:\develop\NHibernate-2.0.1.GA\src\src\NHibernate\Driver

Having done that you need to add those 2 files to the HHibernate project and rebuild.

If you take a look at the files you might notice there isn't exactly very much source, combined with the fact that I have only built one example using NHibernate I would classify my Blackfish support as "experimental" :)

Having compiled the solution you should now be able to open NHibernateConsoleApplication in Delphi Prism.

The first thing your going to have to do is modify the app.config to point to the right location for the Blackfish database file. I have 

      <property name="connection.connection_string">database=C:\Documents and Settings\JohnMoshakis\Application Data\nhibernate.jds;user=SYSDBA;password=masterkey;create=true;protocol=TCP;host=localhost</property>

which is probably different on your machine.

The example has 2 classes Customer and Company and their mapping files. The code is pretty simple it just adds a company and a customer and then performs a query to customers.

Anyway if you decide to download the source, I hope its useful. I intend to continue exploring NHibernate with Blackfish as my database. 

My example can be found here.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Delphi Prism | Blackfish | NHibernate

Related posts

Comments

7/14/2009 10:18:59 PM

pingback

Pingback from answerspluto.com

list of urls - 5 « Answers Pluto

answerspluto.com

5/21/2010 10:25:25 PM

pingback

Pingback from 184.animejin.com

Mercedes Benz 400e Coupon, Best Buy 2400es

184.animejin.com

12/17/2016 5:11:23 PM

pingback

Pingback from steroidsforsale.biz

dbol for sale cheap

steroidsforsale.biz

Comments are closed

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen

About the author

Name of author John Moshakis
I'm a software developer living in Toronto..

E-mail me Send mail

Calendar

<<  November 2017  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Pages

    Recent posts

    Recent comments

    Authors

    Tags

    Don't show

      Disclaimer

      The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

      © Copyright 2017

      Sign in