move join support into base query class so it can be used with updates