query class