Dependent Mapping - Has one class perform the database mapping for a child class.
Dependent Mapping的原理是一个类(称为依赖者)依靠另外的类(称为所有者)来完成自己的数据库持久化的操作。每个依赖者有且仅有一个所有者。依赖者没有 Identity Field,所以没有针对依赖者的查找方法,所有的查找操作都是由其所有者来执行的。这种依赖关系同样可以形成一个层次结构。对于一个对象来说,除了其所有者和依赖于该对象的对象之外,不应该有其它内存中的对象拥有对该对象的引用。在UML里面,依赖者和所有者之间的关系表示为组合。
对数据库的更新操作可以通过简单的全部删除的依赖者,然后重新插入新的全部的依赖者来实现。使用Dependent Mapping的话,要跟踪所有者对象的变化就更困难了。
使用Dependent Mapping的两个前提条件:
- 一个依赖者有且仅有一个所有者。
- 除了所有者和依赖自己的对象之外,没有其它对此对象的引用。
在实际中,避免较大的依赖关系的层次结构。当使用Dependent Mapping时不推荐使用Unit of Work,因为后者可以自动跟踪对象的变化情况。
分享到:
相关推荐
2. **NAT类型**:常见的NAT类型包括Full NAT(静态NAT)、Port Address Translation(PAT,动态NAT)、Endpoint-Independent Mapping(EIM,端口独立映射)和Endpoint-Dependent Mapping(EDM,端口依赖映射)。...
文章还探讨了顶点、几何和片段着色器在实现这些算法中可能扮演的角色,以及基于GPU的多种置换映射方法,包括凸凹映射(bump mapping)、视差映射(parallax mapping)...-dependent displacement mapping)等等...
- **数据依赖球(Data-dependent Ball)**:这是文中提出的一个概念,用于描述如何根据训练数据集来确定最优的属性集合。数据依赖球可能指的是根据数据分布动态调整的特征空间或属性空间。 - **属性空间(Property ...
When mapping from an ER model to a relational model, a strong entity is mapped into a (a) table (b) row (c) column (d) key Correct answer is (a) 10. Which of the following is true about ...
There will be some mapping needed with MCU's own i2c read/write procedures, but the core calculations should remain the same. Functions that need to be implemented for each individual MCU are listed ...
1.2.2. The mapping file 1.2.3. Hibernate configuration 1.2.4. Building with Ant 1.2.5. Startup and helpers 1.2.6. Loading and storing objects 1.3. Part 2 - Mapping associations 1.3.1. Mapping the ...
NHibernate 参考文档手册 chm,NHIBERNATE-符合.Net习惯的关系数据库持久化,手册目录摘要: ... 在集合中出现的依赖对象 (Collections of dependent objects) 7.3. 组件作为IDictionary的索引
在J2EE应用程序中,尤其是在使用对象关系映射(Object/Relational Mapping, O/R Mapping)工具时,开发人员经常面临如何高效地从数据库获取数据的问题。默认情况下,O/R Mapping工具采用延迟加载(Lazy Loading)...
6 Functions of a Complex Variable I Analytic Properties, Mapping 403 6.1 Complex Algebra 404 6.2 Cauchy-Riemann Conditions 413 6.3 Cauchy's Integral Theorem 418 Contents vii 6.4 Cauchy's Integral...
这是一篇关于使用深度学习技术改进定量易感性映射(Quantitative Susceptibility Mapping, QSM)和定量血氧水平依赖性(Quantitative Blood Oxygen Level Dependent, qBOLD)信号幅度(QSM+qBOLD 或 QQ)的氧摄取...
- **SWFRXIPRC (XI-Adapter: Process-Dependent Message Data)**: 存储与过程相关的消息数据。 #### IDoc - **IDXNOALE (suppress IDoc Adapter acknowledgements)**: 控制是否抑制IDoc适配器的确认信息。 #### ...
3.4.4 Comparison of Subcarrier Mapping Schemes 48 3.5 SC-FDMA and Orthogonal Frequency Division Multiple Access 50 3.6 SC-FDMA and CDMA with Frequency Domain Equalization 53 3.7 Single Carrier Code-...
Optionally, you can describe your mapping metadata with attributes in your source code. NHibernate supports transparent persistence, your object classes don't have to follow a restrictive ...
Optionally, you can describe your mapping metadata with attributes in your source code. NHibernate supports transparent persistence, your object classes don't have to follow a restrictive ...
Optionally, you can describe your mapping metadata with attributes in your source code. NHibernate supports transparent persistence, your object classes don't have to follow a restrictive ...
A few simple programs are used to demonstrate the concept of dividing a large task into multiple parallel sub-tasks and mapping them to CPU threads. Multiple ways of parallelizing the same task are ...
英文文献资料中提到的“Space-dependent color gamut mapping”是一种针对图像颜色域转换的变分方法。色域映射是图像处理中的关键步骤,尤其是在将图像从一个设备(如显示器)转移到另一个具有不同色彩再现能力的...
MDI/MDIX全称为Medium Dependent Interface/Medium Dependent Interface Cross-over。MDI通常指的是连接以太网设备的接口,例如连接到网卡(NIC)的RJ-45插孔,而MDIX则是指交叉线缆接口,它可以实现不同以太网设备...
依赖对象(Dependent objects) 7.2. 在集合中出现的依赖对象 7.3. 组件作为Map的索引(Components as Map indices ) 7.4. 组件作为联合标识符(Components as composite identifiers) 7.5. 动态组件 ...