什么是对象标识问题的NHibernate的?标识、对象、问题、NHibernate

2023-09-05 02:21:23 作者:青春荒唐不负你

什么是NHibernate的对象标识问题?

What is the meaning of Object Identity Problem in NHibernate?

推荐答案

对象身份的问题是,有没有完美的(也就是100%准确)的方式,以确保一个普通的CLR对象的对象的身份有一个1: 1映射到NHibernate的对象的身份。

The object identity problem is that there is no perfect (aka 100% exact) way to make sure that an object identity for a plain CLR object has a 1:1 mapping to an object identity in NHibernate.

的原因是,在一种情况下(CLR)由对象指针定义在其他情况下,通过一个数据库ID值对象标识该对象的身份,

The reason is that object identity in the one case (CLR) is defined by the object pointer, object identity in the other case by a database ID value.

因此​​,它可能是不可能的CLR对象完全可靠地映射到一个NHibernate的对象

So it might not be possible to fully reliably map a CLR object to a NHibernate object.

BTW:这是什么特别的NHibernate的,但并不都适用于任何对象 - 关系映射

BTW: That is nothing special to NHibernate but does hold true for any object-relational mapper.