I update the code and make my problem more self explaining.
I added a folder to the entities.
Now if I what to correctly delete a project I have to do it like that:
folder.getProjects().remove(project);
user.getProjects().remove(project);
project.setOwner(null);
project.setFolder(null);
entityManager.remove(project);
This is really annoying as I have to think about adding two more lines for the next OneToMany association.