Added queryAllByHook method