If I have a table with columns A, B, C, D
A: auto-generated id (PK)
B & C: combination must be unique (these are the columns that actually define identity in the business sense)
D: some other columns
Now, if I'll create business objects based on this table (e.g. in Java), which one would be a better implementation of the equals() method:
- define equality based on A
- define equality based on B and C
or, it wouldn't really matter which of the two I choose.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…