Skip to content

Identity (autoincrement) key and unit of work commit #220

Discussion options

You must be logged in to vote

Hi, @martinobordin.
First of all I would like to emphasise that following concepts are essentially independent:

  1. identity of Entity(DDD tactical pattern)
  2. database primary key

Some ORM tools want to deal with object identity on their own terms. To cure this, we need to use two identities. One of the identities is designed for the domain model and adheres to the requirements of the domain. The other is for Hibernate and is known as a surrogate identity...Remember, in this case it[surrogate identity] has nothing to do with the domain-specific identity. It is being created only for the sake of the ORM.
(Vaughn Vernon. IDDD. Chapter 5. Entities. Surrogate key)

You can read more in Entity Id…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by martinobordin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants