Delay joinWith till createCommand to correctly combine relation condition with primary condition.