Autocreation of multi entity queries works

It need refactoring, a lot