Migrate from hibernate session factory to entity manager to allow us to use JPA annotations such as PrePersist