fix failing test

The criteria builder should not create a new Query instance if one already exists.