Added getByQuery methods to Dao class.