I need to execute some statements right after hibernate has startet (creation of SessionFactory, I guess) but before any other tasks start to work with the database.
What would be a good way to do this?
I think, maybe I should write a class that extends LocalContainerEntityManagerFactoryBean and then override createEntityManagerFactoryProxy() from AbstractEntityManger, because this method is the last one that's called in afterPropertiesSet().
Not sure, if this is a good idea or if ther's maybe a better way to do that (hibernate listeners somewhere, ..)?
tia, martin


Reply With Quote