Custom query class setting