add query function in the persistence_impl template