title: Save only a subset of the referenced hibernate collection
body: <p>I am using Hibernate as ORM in my Java application. I have an entity 
  Parent that has a one-to-many relationship to some Child class and cascade type set to 'ALL'. Also in the Child class I've referenced the Parent class with a many-to-one annotation. 
  In the child class I have some methods that decides if the object should be persisted or not. I do this in an PreInsertEventListener that I've added to the sessionfactory registry.
  All goes well in the logs I see only the subset of inserts but when the transaction gets commited I get the error that not all references are saved.</p>
  
  <blockquote>
    <p>org.hibernate.TransientObjectException: object references an unsaved
    transient instance - save the transient instance before flushing.</p>
  </blockquote>
  
  <p>TLDR:
  UI sends me many children object in the parent but I want to save only some of them. 
  Thanks</p>