You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by hesp <ru...@yahoo.com> on 2010/02/12 07:11:09 UTC

Auto generate tables

I am new in use OpenJPA. By default auto generation tables in database is
enabled, but i have to disable it because openJPA offers to generate table
which exists in database. How can I do that?

Please.


-- 
View this message in context: http://n2.nabble.com/Auto-generate-tables-tp4559624p4559624.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Auto generate tables

Posted by hesp <ru...@yahoo.com>.
:) Excuse me. I pasted wrong bean. I use:

<bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter"> 
         <property name="showSql" value="true"/> 
         <property name="generateDdl" value="true"/> 
</bean>
-- 
View this message in context: http://n2.nabble.com/Auto-generate-tables-tp4559624p4565334.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Auto generate tables

Posted by Kevin Sutter <kw...@gmail.com>.
:-)  FYI, based on the configuration posted, you are using the TopLink JPA
provider, not the OpenJPA provider...

On Fri, Feb 12, 2010 at 4:22 PM, hesp <ru...@yahoo.com> wrote:

>
> Hi Kevin,
>
> I found a problem. I use OpenJPA with Spring framework and have bean:
>
>  <bean id="entityManagerFactory"
> class="org.springframework.orm.jpa.ContainerEntityManagerFactoryBean">
>    <property name="dataSource" ref="dataSource"/>
>    <property name="jpaVendorAdapter">
>      <bean
> class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
>        <property name="showSql" value="true"/>
>        <property name="generateDdl" value="true"/>
>        <property name="databasePlatform"
> value="oracle.toplink.essentials.platform.database.HSQLPlatform"/>
>      </bean>
>    </property>
>    <property name="loadTimeWeaver">
>      <bean
> class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"/>
>    </property>
>  </bean>
>
> I only set property "generateDdl" to true and all working fine now.
>
> Thanks.
> --
> View this message in context:
> http://n2.nabble.com/Auto-generate-tables-tp4559624p4563976.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Re: Auto generate tables

Posted by hesp <ru...@yahoo.com>.
Hi Kevin,

I found a problem. I use OpenJPA with Spring framework and have bean:

 <bean id="entityManagerFactory"
class="org.springframework.orm.jpa.ContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="jpaVendorAdapter">
      <bean
class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
        <property name="showSql" value="true"/>
        <property name="generateDdl" value="true"/>
        <property name="databasePlatform"
value="oracle.toplink.essentials.platform.database.HSQLPlatform"/>
      </bean>
    </property>
    <property name="loadTimeWeaver">
      <bean
class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"/>
    </property>
  </bean>

I only set property "generateDdl" to true and all working fine now.

Thanks.
-- 
View this message in context: http://n2.nabble.com/Auto-generate-tables-tp4559624p4563976.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Auto generate tables

Posted by Kevin Sutter <kw...@gmail.com>.
Hi hesp,
You don't mention which release, so I will just use the 2.0.x (trunk)
version of the documentation.  You can access other documentation releases
as well [2].

The forward runtime synchronization is documented here [1].  The interesting
thing is that this is not turned on by default.  So, I'm wondering how you
are getting this capability by default.  Unless you are running with a
persistence.xml file that just happens to have this SynchronizeMappings
property set?

Kevin


[1]
http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_mapping_synch
[2]  http://openjpa.apache.org/documentation.html

On Fri, Feb 12, 2010 at 12:11 AM, hesp <ru...@yahoo.com> wrote:

>
> I am new in use OpenJPA. By default auto generation tables in database is
> enabled, but i have to disable it because openJPA offers to generate table
> which exists in database. How can I do that?
>
> Please.
>
>
> --
> View this message in context:
> http://n2.nabble.com/Auto-generate-tables-tp4559624p4559624.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>