If you're using an EntityManagerFactory component (i.e., you're not using the app
server's EMF), then the hbm2ddl is run by entityManagerFactory's @Create method.
So your @Startup component depends on the database, then you can denote the dependency in
the annotation:
| @Startup(depends={"yourEntityManagerFactoryNameHere"})
|
and your component's @Create method will be run afterwards.
However, instead of using an application-scope/@Startup component, I'd recommend using
an observer of the org.jboss.seam.postInitialization event. It's a bit cleaner, IMO.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112676#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...