Mine was completely different with Spring Boot! For me it was not due to setting collection property.
In my tests I was trying to create an entity and was getting this error for another collection that was unused!
After so much trying I just added a @Transactional
on the test method and it solved it. Don't no the reason though.