openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey" <plins...@gmail.com>
Subject Re: Question:openJpa.How can I automatic generate table using openjpa?
Date Thu, 30 Aug 2007 06:24:02 GMT
Hi,

You can do something similar like so in OpenJPA:

    <property name="openjpa.SynchronizeMappings" value="buildSchema"/>

Personally, for unit testing, I prefer the following:

    <property name="openjpa.SynchronizeMappings"
        value="buildSchema(SchemaAction=add,deleteTableContents)"/>

That will update the schema with any new elements, and will issue
unqualified delete statements against all the tables that OpenJPA
knows about. For tables with a small number of records in them, this
is usually the fastest way to get a clean schema.

-Patrick

On 8/29/07, Keqiang Feng <fengkeqiang@gmail.com> wrote:
> When I use toplink,I put "<property name="toplink.ddl-generation"
> value="create-tables"/>" into persistence.xml.Then i don't need create table
> in database by my hand.I just write a java bean and r/w it from
> database.Ifit's not existed of the table,toplink will create it.
>
> I can't find it in openjpa.If you have this function,please tell me.I think
> it's very useful function.
>
> Thank you!
>


-- 
Patrick Linskey
202 669 5907

Mime
View raw message