When a collection is only created after the owning entity has been persisted, a change to that collection is not made persistent.
The attached test case (run with "mvn test") produces:
2016-07-22 23:15:30,183 DEBUG org.hibernate.SQL - insert into Thing (id) values (null)
2016-07-22 23:15:30,201 DEBUG org.hibernate.SQL - insert into SomeEntity (id) values (null)
2016-07-22 23:15:30,220 DEBUG org.hibernate.SQL - select someentity0_.id as id1_0_0_ from SomeEntity someentity0_ where someentity0_.id=?
2016-07-22 23:15:30,252 DEBUG org.hibernate.SQL - select things0_.SomeEntity_id as SomeEnti1_1_0_, things0_.things_id as things_i2_1_0_, thing1_.id as id1_2_1_ from SomeEntity_Thing things0_ inner join Thing thing1_ on things0_.things_id=thing1_.id where things0_.SomeEntity_id=?
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.748 sec <<< FAILURE!
test(eu.pinske.test.ThingTest) Time elapsed: 2.65 sec <<< FAILURE!
java.lang.AssertionError: relation not persisted expected:<1> but was:<0>
When run without enhancement or when the collection is created before flush (see comment in unit test), the test produces the expected outcome.
I don't know, if this was ever supported, or whether we just relied on unsupported behaviour until now. Would you please take a look?