The problem:
- A DBA-controlled database with a Stored Procedure-only mandate.
- An expectation that the domain be defined in POCO's.
So I decided that I need an ORM designed for stored procedures and/or legacy databases.
Ideally the ORM should allow me to declaratively (or fluently) map domain objects to CRUD stored procedures.
Some findings thus far:
- NHibernate would work if only I could control the queries that are generated for lazy-loading.
- iBATIS.NET would work perfectly, but I can't find any examples of:
- object state tracking (new/updated/deleted/etc)
- parent/child commit transactions (if a parent is updated, update all dirty child objects as well).
- An In-House developed ORM that works with our database conventions is an option and we have already started with this. But I want to make sure we don't have any other choice.
Non-Options:
- SubSonic does wrap stored procs, but it doesn't map between procs and entities. I could implement a mapper of some sort if it came to it, but there are other factors also weighting against SubSonic, such as lacking VS2005 (or SharpDevelop) support and mingling data-access with domain objects.
- Dropping the SProcs is not an option. Data integrity is a HUGE concern for the DBA's and the higher-ups and they feel safest with SProcs. It's not my place to convince them otherwise.
Does anyone know of an ORM that suits my needs, or a way to overcome the limitations in an ORM that doesn't suit my needs 100%?
Any suggestions welcome!