Joshua,

If you deploy an application into an appserver, and your persistence.xml contains the openjpa.jdbc.SynchronizeMappings property, the tables will be created on the 1st emf.createEntityManager() call (or injection of EM that does the same in the background), i.e. on every redeploy or server restart.

It's up to each app server to decide how you can check the deployment status.

Regards,
-marina

Kevin Sutter wrote:
Joshua,
Most definitely you can ask user questions on this list.  Thanks for
posting.

OpenJPA provides the ability to autogenerate the database tables at runtime
via the SynchronizeMappings property in the persistence.xml.  Here's an
example usage:

   <persistence-unit name="inheritance">
       <class>my.persistence.tests.inheritance.RootEntity</class>
       <class>my.persistence.tests.inheritance.LeafEntity</class>
       <class>my.persistence.tests.inheritance.AbstractEntity</class>
       <properties>
           <property name="openjpa.ConnectionDriverName"
               value="org.apache.commons.dbcp.BasicDataSource"/>
           <property name="openjpa.ConnectionProperties"
              value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver
,Url=jdbc:derby:target/temp/play/play.test;create=true,MaxActive=100,MaxWait=10000,TestOnBorrow=true"/>
           <property name="openjpa.jdbc.SynchronizeMappings"
               value="buildSchema(ForeignKeys=true)"/>
           <property name="openjpa.Log" value="DefaultLevel=INFO"/>
       </properties>
   </persistence-unit>


On 5/11/07, Joshua Jackson <[EMAIL PROTECTED]> wrote:


Dear all,

How do I know whether an entity is successfully deployed on an
appserver? Usually I detect this by autogenerating tables in database.
Is there anyway I can autogenerate tables in database with OpenJPA?
I've searched in documentation but perhaps I have missed it when
reading it.

Last but not least, am I allowed to ask user questions in this list?
Since this is a dev list.

Thanks in advance

--
YM!: thejavafreak
Blog: http://www.nagasakti.or.id/roller/joshua/



Reply via email to