什么是NHibernate中的Tuplizer [英] What is Tuplizer in NHibernate
问题描述
我在NHibernate中看到一篇提到Tuplizer的帖子,有人能为Tuplizer提供一个很好的定义或参考吗?
I came across a post that mentioned Tuplizer in NHibernate, can anybody provide a good definition or reference for Tuplizer?
推荐答案
来自
tuplizer为以下内容定义合同
知道如何管理的东西
一件作品的特殊表现
的数据,给定表示的
EntityMode(实体模式
本质上定义了哪个
表示形式.)
A tuplizer defines the contract for
things which know how to manage a
particular representation of a piece
of data, given that representation's
EntityMode (the entity-mode
essentially defining which
representation). 如果认为给定的数据
作为数据结构,然后
翻板机是知道的东西
到: If that given piece of data is thought
of as a data structure, then a
tuplizer is the thing which knows how
to: 例如,给定的数据
可以表示为POCO类.
在这里,它是代表
实体模式为POCO.好一个tuplizer
POCO实体模式会知道
到: For example, a given piece of data
might be represented as a POCO class.
Here, it's representation and
entity-mode is POCO. Well a tuplizer
for POCO entity-modes would know how
to: 同一条数据
也可能表示为DOM
结构,使用tuplizer
与XML实体模式相关联,
这将生成
XmlElement作为数据结构和
知道如何以下列方式访问值
嵌套的XmlElements或as
XmlAttributes. That same piece of data
might also be represented as a DOM
structure, using the tuplizer
associated with the XML entity-mode,
which would generate instances of
XmlElement as the data structure and
know how to access the values as
either nested XmlElements or as
XmlAttributes. tuplizer定义如何将Property-Value转换为其持久表示形式,反之亦然,将Column-Value转换为其内存中表示形式,而EntityMode定义如何使用哪个tuplizer. The tuplizer defines how to transform a Property-Value to its persistent representation, and viceversa a Column-Value to its in-memory representation, and the EntityMode defines which tuplizer is in use. 使用自定义修整器可以做一些事情: Some things you can do with custom tuplizers: 这篇关于什么是NHibernate中的Tuplizer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!