Define base-class for custom query classes.