Databases and Deep Copy

后端 未结 4 537
花落未央
花落未央 2021-01-19 19:32

If I find myself wanting to do a deep copy of an object stored in my relational database, have I necessarily done something fundamentally wrong architecturally? This is a di

4条回答
  •  我寻月下人不归
    2021-01-19 20:02

    Normally if you copy the parent object you would only want to copy the reference to the child object, not the object itself. However, there are cases, like preserving the state of an object at a given point in time, where copying the child object is required. So, to answer your question, this scenario should make you stop and think, but doesn't necessarily mean you're doing something wrong.

提交回复
热议问题