This content has been marked as final.
Show 6 replies
-
1. Re: Auto create schema ?
ericmacau Feb 27, 2006 8:29 AM (in response to ericmacau)Furthermore, is it possible to import some data in a SQL when deploy the EJB3 ?
For example, I packed a data.sql with the EJB3 .jar, can the deployer automatic load the data.sql ? -
2. Re: Auto create schema ?
maxandersen Feb 27, 2006 8:30 AM (in response to ericmacau)tools.hibernate.org for ddl for ejb3 (see hbm2ddl in docs)
put a /import.sql in there and hibernate will pick it up and execute. -
3. Re: Auto create schema ?
ericmacau Feb 28, 2006 3:40 AM (in response to ericmacau)Yes, Hibernate will automatic execute the /Import.sql.
The problem is that JBoss will not create the schema for the EJB3 if I did not add a properties<property name="hibernate.hbm2ddl.auto" value="create"/>
If I add the above property to the persistence.xml, it will re-create all the tables each time I startup the JBoss.
How to make the Jboss to create the schema only once ??? -
4. Re: Auto create schema ?
persabi Feb 28, 2006 4:03 AM (in response to ericmacau)Try setting value="update" for hibernate.hbm2ddl.auto
-
5. Re: Auto create schema ?
ericmacau Feb 28, 2006 7:42 AM (in response to ericmacau)After use UPDATE, it will not run the import.sql !!!!
-
6. Re: Auto create schema ?
gus888 Feb 28, 2006 10:00 AM (in response to ericmacau)Whether you may try CREATE at first, after import data.sql, then change to UPDATE.