Please run this query on the attached DB:
SELECT DISTINCT $1 FROM com.quasado.serviceplaza.customer.VendorCustomer $1 JOIN $1.qubletFRAGMENTMAP $2, com.quasado.foundation.warehouse.contract.customer.CustomerContractsFragment $3 WHERE ((NOT (($2=$3) AND ($3.contracts IS EMPTY))))
The problem is quite easy: The "VendorCustomer" class inherits from the "Customer" class.
Now with this query I do select from "VendorCustomer" yet through using the join, he is also selecting all "Customer" classes which fullfill the where requirements. This seems to be clearly wrong to me because I should not even join the $1.qubletFRAGMENTMAP of any other class but "VendorCustomer"!?