Class EntityInsertActionResolver

java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.cascade.EntityInsertActionResolver

public class EntityInsertActionResolver extends Object
Input: an unordered list of Entity instances that were newly created during a transaction Output: a list of EntityInsertAction instances that are ordered such that they don't cause any constraint violations during insertion. Basically we need to make sure that no entities will be passed to Session.persist(Object) which contain a non-nullable, transient many-to-one reference. If we encounter this situation (an unsaved entity that has a many-to-one reference (that is mandatory) to another unsaved entity, we make sure that the referenced entity is persisted first. The rest (many to many or nullable many to one is handled by Hibernate).