views:

154

answers:

2

Is there a ORM that would

  • leave my entities classes clean, withouth any attributes for properties and classes
  • would not be ActiveRecord pattern so it should not have entity.Save/Delete etc.

optional: able to execute stored procedures and parse the result into entityies

+4  A: 

Sounds like NHibernate is what you need. This uses a mapping file (in XML) to map the properties of classes to the database. Entities are managed through a SessionManager interface.

Documentation is here.

A mapping file can also map from a stored procedure to your persistent objects. Details here.

Jeremy McGee
my thoughts exactly.
Frederik Gheysels
+1, but see my answer for additional comments.
Mark Seemann
Those links are to an older (1.2) version of NHibernate. More recent documentation is here: http://www.nhforge.org/doc/nh/en/index.html
Michael Maddox
Thanks Michael - I've edited my answer.
Jeremy McGee
Mark - I agree about "wait and see" regarding the Entity Framework.
Jeremy McGee
Agree. Mapping can however also be done with attributes (which isn't POCO and not what the asker wanted), and with C# (http://fluentnhibernate.org/).
Martin R-L
+2  A: 

What you are looking for is commonly referred to as Persistence Ignorance. It seems that the preferred framework for that is NHibernate, so I second Jeremy McGee's answer.

For completeness' sake I'd like to point out Microsoft's Entity Framework will get Persistence Ignorance in the next version (.NET 4) - they call it POCO support. Whether it will actually turn out to be any good remains to be seen...

Mark Seemann