News for hackers. Stuff that matters.
Re:Problems with JPA/Hibernate by Ygg2 on Monday April 12, 2021 @02:10AM (#26776448)
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.

There are no comments on this comment yet.