loadReferenceManyCollectionOwningSide throws 'Invalid type specified ""'

When I tried to load any @ReferenceMany I got the exception 'Invalid type specified ""'

this occurred simply because prepareQueryElement did not take the targetClass into account and always searched in it's own collection.