Note: this post has been in my drafts for so long I’ve changed company and so this isn’t strictly relevant to me now. I developed this in my own time while working at my previous company and I figure it may come in useful to someone.
I’ve done some initial code to make NHibernate work with both DBF and ADT files.
I’ve put a sample solution up with both DBF and ADT configuration files. I’ve created a dialect and a driver for them. I’ve also found it necessary to create an ID provider in order to deal with the DBF’s. Since the NHibernate team recommends using a HiLo ID creator however it seems to make sense for the ADT dialect to also specify that by default. I found it necessary to create the ID provider because ADS provides an odd way to lock records that isn’t done via SQL, it’s done via their data provider classes.
This dialect does the bare minimum to support the sample I found at the start of my NHibernate In Action book. It does no more. It doesn’t do anything like type mapping or any of the other things a dialect normally does.
I’m not sure what to do with this next. I have tried running it against the NHibernate tests but there are so many failures because I’ve not implemented the basic things it’s a bit hard to see where to go.
For now I think I’ll see if I can use it in practice and then see where the holes are.
The one less than ideal thing that I’ve had to do is with the IIdentifierGenerator is basically copy the bits of code I wanted from the TableGenerator class and then modify them as required. I get the feeling that having to lock records in the manner I’ve needed to isn’t particularly common though.
To see the project and example download it from here. You also need to download the Advantage Data Provider from http://devzone.advantagedatabase.com/dz/content.aspx?key=20&Release=13&Product=4&Platform=11.