Add support for endPersistence() to Persistent models