I have improved the Inequality test in the model template, as requested by JimR. This was another case where it worked well for me, only because I followed the convention that primary keys are named ID, and foreign keys are named SingularOfTable_ID. I know that I should really push the Inequality test into the template, but for now, I have corrected it in the DbFieldInfo class.
My current development environment is Visual Studio Express C# Edition (read that as free ), Castle ActiveRecord's latest svn trunk(usually within a few days), and NHibernate svn trunk. As of NHibernate version 1.2.0, there is a very cool new class out there ... DetachedCriteria. This class lets you set all of your Castle relational attributes like BelongsTo, HasMany, etc. as lazy fetch, and over-ride this for searches, reports, or anytime you know ahead of time that you will be touching the related classes by calling detachedCriteria.SetFetchMode(..., FetchEnum.Eager). As a good netizen, I have tried to contribute to NHibernate and Castle ActiveRecord even if only in the smallest of ways . Oh yeah, I tried mapping to a SQL VIEW, and it worked GREAT! I received a comment after my last post, indicating that there is a better way, and I am sure of it, but the view guaranteed that I only have one database request for my dataset. NHibernate was wanting to re-fetch my missing as
Comments
I beleive that I have one remaining issue to get the generated classes that I need. I am not getting the "HasMany" properties generated. I suspect this is due to my naming scheme not matching yours. I am going to research and attempt to get it to work for me. Of course, I will continue to share what ever I find.
Working with your generator and the code it produces has taught me more about ActiveRecord than the getting started tuitorial on the Castle site did. Thanks.
I hope I am not being too much of a pest.
BTW, I used to live in Oklahoma. I have been gone for several years, but miss it. I do not qualify to be an okie, but both of my children do. :)
If you would submit a SQL script that creates several tables and their relations, I could test my templates against them.
Good Luck, and Happy Hibernating!