Hibernate has been giving me a consistent problem for the past several weeks: I could not get my Set<String> collection changes to persist even though I could load them from the database just fine.

Turns out, there’s something I didn’t realize about hibernate element collections: hibernate provides its own implementations of Set, List, etc. So if you pre-initialize your collection field, and use the setter to append data (like I was) then you’ll face this problem.