4

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

Péter Török
  • 114,404
  • 31
  • 268
  • 329
Omu
  • 69,856
  • 92
  • 277
  • 407

2 Answers2

4

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
  • 24,842
  • 10
  • 63
  • 95
  • 1
    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 Dec 31 '09 at 12:32
  • Mark - I agree about "wait and see" regarding the Entity Framework. – Jeremy McGee Dec 31 '09 at 17:58
  • 1
    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 Jan 04 '10 at 00:03
3

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
  • 225,310
  • 48
  • 427
  • 736