-
1. Jboss 4.2 and Hibernate: How do I autogenerate tables in database
immitev May 1, 2011 4:20 AM (in response to immitev)Small adition: The DataSource file declared in the hibernate.cfg.xml is in the Jboss_Home/server/default/deploy. Here is the file:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>SampleDS</jndi-name>
<connection-url>jdbc:mysql://localhost/astrachallenge</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<min-pool-size>1</min-pool-size>
<max-pool-size>20</max-pool-size>
<user-name>root</user-name>
<password>kralitsa6817</password>-->
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
-
2. Jboss 4.2 and Hibernate: How do I autogenerate tables in database
devinderpal May 2, 2011 3:12 PM (in response to immitev)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.