一、介绍

1.这种引用方式不对,但删除时不能级联

要这种引用方式

2.The Bid class could be a problem. In object-oriented modeling, this is marked as a composition (the association between Item and Bid with the diamond). Thus, an Item is the owner of its Bid instances and holds a collection of references. At first, this seems reasonable, because bids in an auction system are useless when the item they

were made for is gone.But what if a future extension of the domain model requires a User#bids collection, containing all bids made by a particular User ? Right now, the association between Bid and User is unidirectional; a Bid has a bidder reference. What if this was bidirectional?
In that case, you have to deal with possible shared references to Bid instances, so the Bid class needs to be an entity. It has a dependent life cycle, but it must have its own identity to support (future) shared references.

3.编写实体类和值对象时,注意以下3点:

(1)Shared references—Avoid shared references to value type instances when you write your POJO classes.

(2)Life cycle dependencies—If a User is deleted, its Address dependency has to be deleted as well.

(3)Identity—Entity classes need an identifier property in almost all cases. Value type classes (and of course JDK classes such as String and Integer ) don’t have an identifier property, because instances are identified through the owning entity.

最新文章

  1. ASP.NET Core 中文文档 第二章 指南(5) 在 Nano Server 上运行ASP.NET Core
  2. zigbee 路由节点丢失后清除 该节点的残余网络信息
  3. 【Excel】宏之初认识
  4. iOS小技巧总结,绝对有你想要的
  5. JS魔法堂:通过marquee标签实现信息滚动效果
  6. Google Code jam Qualification Round 2015 --- Problem A. Standing Ovation
  7. css清除浮动的两种方式(clearfix和clear)
  8. [React Testing] The Redux Store - Multiple Actions
  9. 前端MVC学习笔记(二)——AngularJS验证、过滤器、指令
  10. cs231n spring 2017 lecture12 Visualizing and Understanding 听课笔记
  11. Yii的Relational Active Record三张表连接查询
  12. 转载:Centos升级gcc
  13. 解决Docker中运行的MySQL中文乱码
  14. odoo11 访问web/database/manager管理数据库页面布局混乱问题
  15. python中的各种模块(np,os,shutill)
  16. jq demo—图片翻页展示效果 animate()动画
  17. 深入理解JSON
  18. Day07 jdk5.0新特性&Junit&反射
  19. Facebook的工程师文化——《打造facebook》读后感
  20. (转)libvirt API的基本概念

热门文章

  1. FPGA入门1
  2. [原]Java修炼 之 基础篇(一)Java语言特性
  3. Ant学习---第四节:Ant属性的介绍
  4. B-tree/B+tree/B*tree [转]
  5. IOS用CGContextRef画各种图形(文字、圆、直线、弧线、矩形、扇形、椭圆、三角形、圆角矩形、贝塞尔曲线、图片)
  6. 五、案例-指令参考-freemarker指令、表达式
  7. 关于网站IIS日志分析搜索引擎爬虫说明
  8. Careercup - Microsoft面试题 - 5752271719628800
  9. Incorrect string value: '\xF0\xA1\xA1\x92' for column 'herst' at row 1
  10. python-转换成exe文件(py2exe)