interface to implement when creating a query.