Fix for D2643 - Fatal error adding where clause to query object when fromEntityType is set
+ tests