3 ms·
Sets in Hibernate suffer because you can store an object before it was updated and Hibernate will update it. E.g. If say Person { id: Integer,
by Ygg2 6y ago
Sets in Hibernate suffer because you can store an object before it was updated and Hibernate will update it.
E.g. If say
Person {
id: Integer,
name: String
}
Let's say I have some entity that stores Persons as HashSet. If I add them before saving, their hash set is taken without Id.
Id can be automatically generated by Hibernate on save/create.
After save the Id now has a new value. I.e. its hash differs from when it was saved.
Boom. You have HashSet with Zombie entries. That are technically that you can't fetch actually.