Does nhibernate use a generic hash and equality generator (derived from primary key definitions) for its identity map? That’s one way of doing it I guess. I was wondering how nhibernate went about achieving this.
Why bother? I was asked to use a database that could use nhibernate, but it is not supported by the community right now (it was in the past). Just want to hack my way forward. I may come back to this later and write that nhibernate layer / plugin, but that’s overkill and a little bit beyond my resources at this time.
After posting the question I found these refences below [1]. It’d be nice to find a book or a web post that went through the different edge cases.
reference [1]:
Take a look at
in Nhibernate sources for a good identity map implementation.
If I understood you correctly you wanted to write your own ORM-like layer because NHibernate does not support the database you want. It can be a daunting task. You might want to look at extending NHibernate by providing your own Driver and Dialect.
There is already a a very good description in Java Persistence with Hibernate: 9.2 Object identity and equality. And in online NHibernate docs: 4.3. Implementing Equals() and GetHashCode().