hibernate: Custom code on insert / update
问题 I'm new to hibernate and trying to evaluate if I can actually use it for my project. One type of entity needs to do some special checks on insert or update. I'm going to try to explain as easy as possible. Lets say we have colors. A user can create a Mixture of n colors and store that mixture in the database. Later if a user searches for color "blue" all Mixtures containing blue should be displayed. Business rule is that any color should only be in the database once. So if a new mixture is