DDD, value objects and ORM

前端 未结 5 1959
情书的邮戳
情书的邮戳 2020-12-14 09:56

Value objects do not have identity. ORM needs identity to update the database.

How to trick ORM?

(Marking Id for value object as internal won\'t work bec

5条回答
  •  渐次进展
    2020-12-14 10:49

    Personally I have the Id field in the value object - I treat it as another attribute of the value object (such as name, location etc).

    It may not be true DDD but it works for me.

提交回复
热议问题