added generic entity listener which handles prepersist callbacks.