Created interface to avoid dependence on AbstractQuery.