In JBoss 6, you can add persistence.xml with below settings. This file is in META-INF dir of EJB.
<persistence-unit name="<some name>" transaction-type="JTA">
<jta-data-source>java:DefaultDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update" />
</properties>
</persistence-unit>
Not sure if this will work with Jboss 4. But I think similar settings will go into hibernate.cfg.xml file to autogenerate tables.