Add prePersit and postPersist callbacks