You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by David Beer <da...@googlemail.com> on 2009/02/09 23:14:21 UTC

Database Schema Generation

Hi All

I have successsfully set the Schema in the persistence.xml file. My question
is how do I get the schma auto generated when the table are generated. I am
using the h2 database.

Any guidence would helpful.

Thanks

David

Re: Database Schema Generation

Posted by David Beer <da...@googlemail.com>.
To vote or add your own comments see Jira issue
OPENJPA-929<https://issues.apache.org/jira/browse/OPENJPA-929>
.

David

2009/2/19 Ognjen Blagojevic <og...@rcub.bg.ac.rs>

> It would be nice to have it. Less work when starting up with OpenJPA.
>
> -Ognjen
>
>
> David Beer wrote:
>
>> Hi Milosz
>>
>> Thank you for checking this, much apreciated. Would anybody else benefit
>> from having this as a feature. If so I will create an item in jira.
>>
>> Thanks
>>
>> David
>>
>> 2009/2/17 Miłosz Tylenda <mt...@o2.pl>
>>
>>  Hi David,
>>>
>>> My understanding of the JPA spec is that it does not address database
>>> schema generation. I have found the following quote in both JPA 1 and JPA
>>> 2
>>> Public Draft:
>>>
>>> "It is permitted, but not required, that DDL generation be supported by
>>> an
>>> implementation of this specification.
>>> Portable applications should not rely upon the use of DDL generation."
>>>
>>> So, i would say that the schema tool is an OpenJPA's extension to JPA and
>>> the lack of "CREATE SCHEMA" functionality is a limitation in the tool.
>>>
>>> Regards,
>>> Milosz
>>>
>>>
>>>  Hi Milosz
>>>>
>>>> Thanks for the reply. that is quite annoying. Is this a limitation in
>>>> the
>>>> openjpa  tool or in JPA? I am just curious as this would speed things up
>>>>
>>> a
>>>
>>>> little when testing.
>>>>
>>>> David
>>>>
>>>> 2009/2/15 Miłosz Tylenda
>>>>
>>>>  David,
>>>>> I am afraid that the schema tool will not create the necessary schemas
>>>>>
>>>> and
>>>
>>>> you have to do it manually. I had a similar problem with PostgreSQL.
>>>>>
>>>> This is
>>>
>>>> a quote from the manual:
>>>>> "The schema tool manipulates tables, columns, indexes, constraints, and
>>>>> sequences. It cannot create or drop the database schema objects in
>>>>>
>>>> which the
>>>
>>>> tables reside, however. If your XML documents refer to named database
>>>>> schemas, those schemas must exist."
>>>>> The only case I am aware of where your example will work is when you
>>>>>
>>>> use
>>>
>>>> DB2 or Derby - these databases create schemas implicitly when CREATE
>>>>>
>>>> TABLE
>>>
>>>> refers to them.
>>>>> Greetings,
>>>>> Milosz
>>>>> Hi JudesThanks for the link. I thought I had specified the version in
>>>>>
>>>> my
>>>
>>>> first e-mail, but here it is I am using openjpa 1.0.1. I have attached
>>>>>
>>>> both
>>>
>>>> the stack trace and have pasted a snipit of my persistence.xml
>>>>> file.<persistence-unit name="Veilig-Dev-PU"
>>>>> transaction-type="RESOURCE_LOCAL">
>>>>>
>>>>>
>>>>>  <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>>>
>>>>  <class>veilig.entry.AdditionalInformation</class>
>>>>>  <class>veilig.application.Application</class>
>>>>>  <class>veilig.entry.Entry</class>
>>>>>  <properties>
>>>>>  <property name="openjpa.ConnectionPassword" value="app"/>
>>>>>  <property name="openjpa.ConnectionDriverName"
>>>>> value="org.h2.Driver"/>
>>>>>  <property name="openjpa.ConnectionUserName" value="app"/>
>>>>>  <property name="openjpa.ConnectionURL"
>>>>> value="jdbc:h2:./data/veilig"/>
>>>>>  <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO,
>>>>> Tool=INFO, SQL=TRACE"/>
>>>>>  <!--<property name="openjpa.jdbc.SynchronizeMappings"
>>>>> value="buildSchema(ForeignKeys=true)"/>-->
>>>>>  <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"
>>>>> />
>>>>>  <property name="openjpa.jdbc.Schema" value="Veilig"/>
>>>>>  <property name="openjpa.jdbc.DBDictionary"
>>>>>
>>>>> value="org.apache.openjpa.jdbc.sql.H2Dictionary(useGetObjectForBlobs=false)"/>
>>>
>>>>  </properties>
>>>>>  </persistence-unit>
>>>>> Thanks for your help much apreciated.
>>>>> 2009/2/13 Judes Tumuhairwe <judethecutedude@gmail.com
>>>>> Hi David,
>>>>> What Martin suggested is right. Just add that *property* element to
>>>>>
>>>> your
>>>
>>>> persistence-unit in your persistence.xml.
>>>>> <properties>
>>>>> <property name="openjpa.jdbc.SynchronizeMappings"
>>>>>
>>>>> value="buildSchema(SchemaAction=add,deleteTableContents,ForeignKeys=true)"
>>>
>>>> />
>>>>> </properties>
>>>>> No, the properties don't have to appear is a specific order. It's not
>>>>>
>>>> easy
>>>
>>>> to help you when all we have is "it doesn't seem to work". What version
>>>>>
>>>> of
>>>
>>>> openJPA are you running, is there a stacktrace, a sample of your
>>>>> persistence.xml, anything at all. Perhaps it is an integration issue.
>>>>> I don't know where the documentation is either but I just googled
>>>>>
>>>> 'openjpa
>>>
>>>> persistence.xml' & got a complete example of OpenJPA with H2
>>>>> configuration
>>>>> here [1]
>>>>> Does anyone on else know the possible values [chapter 2 (Configuration)
>>>>>
>>>> of
>>>
>>>> the manual on the website had the properties but doesn't have their
>>>>> possible/legal values]
>>>>> [1] http://www.jpox.org/servlet/forum/viewthread?thread=4188
>>>>> regards,
>>>>> Judes
>>>>> On Thu, Feb 12, 2009 at 2:20 PM, David Beer &
>>>>> lt;david.m.beer@googlemail.com <lt...@googlemail.com> <
>>>>> lt%3Bdavid.m.beer@googlemail.com <lt...@googlemail.com>>
>>>>>
>>>>>  wrote:
>>>>>> Hi All
>>>>>>
>>>>>> Can anyone help with this. Is it possible this just doesn't work with
>>>>>>
>>>>> the
>>>>>
>>>>>> h2
>>>>>> database or should my persistence.xml file be in a specific order. As
>>>>>>
>>>>> in
>>>>>
>>>>>> have the values and properties got to be in a specific order? Is it
>>>>>>
>>>>> worth
>>>>>
>>>>>> upgrading to a newer version of openjpa, would this solve my issue?
>>>>>>
>>>>>> David
>>>>>>
>>>>>> 2009/2/10 David Beer <david.m.beer@googlemail.com
>>>>>>
>>>>>>
>>>>>>  Hi Martin
>>>>>>>
>>>>>>> Thanks for your suggestion, I have tried entering the value but
>>>>>>>
>>>>>> it
>>>>>
>>>>>> doesn't
>>>>>>
>>>>>>> seem to work. Where did you find the documentation values for
>>>>>>> jdbc.SynchroniseMappings
>>>>>>>
>>>>>>> David
>>>>>>>
>>>>>>> 2009/2/9 Martin Uhlir <stoupa91devel@seznam.cz
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> put this property into properties list in the persistence.xml
>>>>>>>>
>>>>>>>> <property name="openjpa.jdbc.SynchronizeMappings"
>>>>>>>> value="buildSchema(SchemaAction='add')"/>
>>>>>>>>
>>>>>>>> Martin
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> David Beer wrote:
>>>>>>>>
>>>>>>>>  Hi All
>>>>>>>>>
>>>>>>>>> I have successsfully set the Schema in the
>>>>>>>>>
>>>>>>>> persistence.xml file. My
>>>>>
>>>>>> question
>>>>>>>>> is how do I get the schma auto generated when the table
>>>>>>>>>
>>>>>>>> are generated.
>>>>>
>>>>>> I
>>>>>>
>>>>>>> am
>>>>>>>>> using the h2 database.
>>>>>>>>>
>>>>>>>>> Any guidence would helpful.
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> David
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>
>

Re: Database Schema Generation

Posted by Ognjen Blagojevic <og...@rcub.bg.ac.rs>.
It would be nice to have it. Less work when starting up with OpenJPA.

-Ognjen


David Beer wrote:
> Hi Milosz
> 
> Thank you for checking this, much apreciated. Would anybody else benefit
> from having this as a feature. If so I will create an item in jira.
> 
> Thanks
> 
> David
> 
> 2009/2/17 Miłosz Tylenda <mt...@o2.pl>
> 
>> Hi David,
>>
>> My understanding of the JPA spec is that it does not address database
>> schema generation. I have found the following quote in both JPA 1 and JPA 2
>> Public Draft:
>>
>> "It is permitted, but not required, that DDL generation be supported by an
>> implementation of this specification.
>> Portable applications should not rely upon the use of DDL generation."
>>
>> So, i would say that the schema tool is an OpenJPA's extension to JPA and
>> the lack of "CREATE SCHEMA" functionality is a limitation in the tool.
>>
>> Regards,
>> Milosz
>>
>>
>>> Hi Milosz
>>>
>>> Thanks for the reply. that is quite annoying. Is this a limitation in the
>>> openjpa  tool or in JPA? I am just curious as this would speed things up
>> a
>>> little when testing.
>>>
>>> David
>>>
>>> 2009/2/15 Miłosz Tylenda
>>>
>>>> David,
>>>> I am afraid that the schema tool will not create the necessary schemas
>> and
>>>> you have to do it manually. I had a similar problem with PostgreSQL.
>> This is
>>>> a quote from the manual:
>>>> "The schema tool manipulates tables, columns, indexes, constraints, and
>>>> sequences. It cannot create or drop the database schema objects in
>> which the
>>>> tables reside, however. If your XML documents refer to named database
>>>> schemas, those schemas must exist."
>>>> The only case I am aware of where your example will work is when you
>> use
>>>> DB2 or Derby - these databases create schemas implicitly when CREATE
>> TABLE
>>>> refers to them.
>>>> Greetings,
>>>> Milosz
>>>> Hi JudesThanks for the link. I thought I had specified the version in
>> my
>>>> first e-mail, but here it is I am using openjpa 1.0.1. I have attached
>> both
>>>> the stack trace and have pasted a snipit of my persistence.xml
>>>> file.<persistence-unit name="Veilig-Dev-PU"
>>>> transaction-type="RESOURCE_LOCAL">
>>>>
>>>>
>>  <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>>>>  <class>veilig.entry.AdditionalInformation</class>
>>>>  <class>veilig.application.Application</class>
>>>>  <class>veilig.entry.Entry</class>
>>>>  <properties>
>>>>  <property name="openjpa.ConnectionPassword" value="app"/>
>>>>  <property name="openjpa.ConnectionDriverName"
>>>> value="org.h2.Driver"/>
>>>>  <property name="openjpa.ConnectionUserName" value="app"/>
>>>>  <property name="openjpa.ConnectionURL"
>>>> value="jdbc:h2:./data/veilig"/>
>>>>  <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO,
>>>> Tool=INFO, SQL=TRACE"/>
>>>>  <!--<property name="openjpa.jdbc.SynchronizeMappings"
>>>> value="buildSchema(ForeignKeys=true)"/>-->
>>>>  <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"
>>>> />
>>>>  <property name="openjpa.jdbc.Schema" value="Veilig"/>
>>>>  <property name="openjpa.jdbc.DBDictionary"
>>>>
>> value="org.apache.openjpa.jdbc.sql.H2Dictionary(useGetObjectForBlobs=false)"/>
>>>>  </properties>
>>>>  </persistence-unit>
>>>> Thanks for your help much apreciated.
>>>> 2009/2/13 Judes Tumuhairwe <judethecutedude@gmail.com
>>>> Hi David,
>>>> What Martin suggested is right. Just add that *property* element to
>> your
>>>> persistence-unit in your persistence.xml.
>>>> <properties>
>>>> <property name="openjpa.jdbc.SynchronizeMappings"
>>>>
>> value="buildSchema(SchemaAction=add,deleteTableContents,ForeignKeys=true)"
>>>> />
>>>> </properties>
>>>> No, the properties don't have to appear is a specific order. It's not
>> easy
>>>> to help you when all we have is "it doesn't seem to work". What version
>> of
>>>> openJPA are you running, is there a stacktrace, a sample of your
>>>> persistence.xml, anything at all. Perhaps it is an integration issue.
>>>> I don't know where the documentation is either but I just googled
>> 'openjpa
>>>> persistence.xml' & got a complete example of OpenJPA with H2
>>>> configuration
>>>> here [1]
>>>> Does anyone on else know the possible values [chapter 2 (Configuration)
>> of
>>>> the manual on the website had the properties but doesn't have their
>>>> possible/legal values]
>>>> [1] http://www.jpox.org/servlet/forum/viewthread?thread=4188
>>>> regards,
>>>> Judes
>>>> On Thu, Feb 12, 2009 at 2:20 PM, David Beer &
>>>> lt;david.m.beer@googlemail.com <lt...@googlemail.com>
>>>>> wrote:
>>>>> Hi All
>>>>>
>>>>> Can anyone help with this. Is it possible this just doesn't work with
>>>> the
>>>>> h2
>>>>> database or should my persistence.xml file be in a specific order. As
>>>> in
>>>>> have the values and properties got to be in a specific order? Is it
>>>> worth
>>>>> upgrading to a newer version of openjpa, would this solve my issue?
>>>>>
>>>>> David
>>>>>
>>>>> 2009/2/10 David Beer <david.m.beer@googlemail.com
>>>>>
>>>>>
>>>>>> Hi Martin
>>>>>>
>>>>>> Thanks for your suggestion, I have tried entering the value but
>>>> it
>>>>> doesn't
>>>>>> seem to work. Where did you find the documentation values for
>>>>>> jdbc.SynchroniseMappings
>>>>>>
>>>>>> David
>>>>>>
>>>>>> 2009/2/9 Martin Uhlir <stoupa91devel@seznam.cz
>>>>>>> Hi,
>>>>>>>
>>>>>>> put this property into properties list in the persistence.xml
>>>>>>>
>>>>>>> <property name="openjpa.jdbc.SynchronizeMappings"
>>>>>>> value="buildSchema(SchemaAction='add')"/>
>>>>>>>
>>>>>>> Martin
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> David Beer wrote:
>>>>>>>
>>>>>>>> Hi All
>>>>>>>>
>>>>>>>> I have successsfully set the Schema in the
>>>> persistence.xml file. My
>>>>>>>> question
>>>>>>>> is how do I get the schma auto generated when the table
>>>> are generated.
>>>>> I
>>>>>>>> am
>>>>>>>> using the h2 database.
>>>>>>>>
>>>>>>>> Any guidence would helpful.
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> David
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
> 


Re: Database Schema Generation

Posted by David Beer <da...@googlemail.com>.
Hi Milosz

Thank you for checking this, much apreciated. Would anybody else benefit
from having this as a feature. If so I will create an item in jira.

Thanks

David

2009/2/17 Miłosz Tylenda <mt...@o2.pl>

> Hi David,
>
> My understanding of the JPA spec is that it does not address database
> schema generation. I have found the following quote in both JPA 1 and JPA 2
> Public Draft:
>
> "It is permitted, but not required, that DDL generation be supported by an
> implementation of this specification.
> Portable applications should not rely upon the use of DDL generation."
>
> So, i would say that the schema tool is an OpenJPA's extension to JPA and
> the lack of "CREATE SCHEMA" functionality is a limitation in the tool.
>
> Regards,
> Milosz
>
>
> > Hi Milosz
> >
> > Thanks for the reply. that is quite annoying. Is this a limitation in the
> > openjpa  tool or in JPA? I am just curious as this would speed things up
> a
> > little when testing.
> >
> > David
> >
> > 2009/2/15 Miłosz Tylenda
> >
> > > David,
> > > I am afraid that the schema tool will not create the necessary schemas
> and
> > > you have to do it manually. I had a similar problem with PostgreSQL.
> This is
> > > a quote from the manual:
> > > "The schema tool manipulates tables, columns, indexes, constraints, and
> > > sequences. It cannot create or drop the database schema objects in
> which the
> > > tables reside, however. If your XML documents refer to named database
> > > schemas, those schemas must exist."
> > > The only case I am aware of where your example will work is when you
> use
> > > DB2 or Derby - these databases create schemas implicitly when CREATE
> TABLE
> > > refers to them.
> > > Greetings,
> > > Milosz
> > > Hi JudesThanks for the link. I thought I had specified the version in
> my
> > > first e-mail, but here it is I am using openjpa 1.0.1. I have attached
> both
> > > the stack trace and have pasted a snipit of my persistence.xml
> > > file.<persistence-unit name="Veilig-Dev-PU"
> > > transaction-type="RESOURCE_LOCAL">
> > >
> > >
>  <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
> > >  <class>veilig.entry.AdditionalInformation</class>
> > >  <class>veilig.application.Application</class>
> > >  <class>veilig.entry.Entry</class>
> > >  <properties>
> > >  <property name="openjpa.ConnectionPassword" value="app"/>
> > >  <property name="openjpa.ConnectionDriverName"
> > > value="org.h2.Driver"/>
> > >  <property name="openjpa.ConnectionUserName" value="app"/>
> > >  <property name="openjpa.ConnectionURL"
> > > value="jdbc:h2:./data/veilig"/>
> > >  <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO,
> > > Tool=INFO, SQL=TRACE"/>
> > >  <!--<property name="openjpa.jdbc.SynchronizeMappings"
> > > value="buildSchema(ForeignKeys=true)"/>-->
> > >  <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"
> > > />
> > >  <property name="openjpa.jdbc.Schema" value="Veilig"/>
> > >  <property name="openjpa.jdbc.DBDictionary"
> > >
> value="org.apache.openjpa.jdbc.sql.H2Dictionary(useGetObjectForBlobs=false)"/>
> > >  </properties>
> > >  </persistence-unit>
> > > Thanks for your help much apreciated.
> > > 2009/2/13 Judes Tumuhairwe <judethecutedude@gmail.com
> > > >
> > > Hi David,
> > > What Martin suggested is right. Just add that *property* element to
> your
> > > persistence-unit in your persistence.xml.
> > > <properties>
> > > <property name="openjpa.jdbc.SynchronizeMappings"
> > >
> value="buildSchema(SchemaAction=add,deleteTableContents,ForeignKeys=true)"
> > > />
> > > </properties>
> > > No, the properties don't have to appear is a specific order. It's not
> easy
> > > to help you when all we have is "it doesn't seem to work". What version
> of
> > > openJPA are you running, is there a stacktrace, a sample of your
> > > persistence.xml, anything at all. Perhaps it is an integration issue.
> > > I don't know where the documentation is either but I just googled
> 'openjpa
> > > persistence.xml' & got a complete example of OpenJPA with H2
> > > configuration
> > > here [1]
> > > Does anyone on else know the possible values [chapter 2 (Configuration)
> of
> > > the manual on the website had the properties but doesn't have their
> > > possible/legal values]
> > > [1] http://www.jpox.org/servlet/forum/viewthread?thread=4188
> > > regards,
> > > Judes
> > > On Thu, Feb 12, 2009 at 2:20 PM, David Beer &
> > > lt;david.m.beer@googlemail.com <lt...@googlemail.com>
> > > >wrote:
> > > > Hi All
> > > >
> > > > Can anyone help with this. Is it possible this just doesn't work with
> > > the
> > > > h2
> > > > database or should my persistence.xml file be in a specific order. As
> > > in
> > > > have the values and properties got to be in a specific order? Is it
> > > worth
> > > > upgrading to a newer version of openjpa, would this solve my issue?
> > > >
> > > > David
> > > >
> > > > 2009/2/10 David Beer <david.m.beer@googlemail.com
> > > >
> > > >
> > > > > Hi Martin
> > > > >
> > > > > Thanks for your suggestion, I have tried entering the value but
> > > it
> > > > doesn't
> > > > > seem to work. Where did you find the documentation values for
> > > > > jdbc.SynchroniseMappings
> > > > >
> > > > > David
> > > > >
> > > > > 2009/2/9 Martin Uhlir <stoupa91devel@seznam.cz
> > > >
> > > > >
> > > > >> Hi,
> > > > >>
> > > > >> put this property into properties list in the persistence.xml
> > > > >>
> > > > >> <property name="openjpa.jdbc.SynchronizeMappings"
> > > > >> value="buildSchema(SchemaAction='add')"/>
> > > > >>
> > > > >> Martin
> > > > >>
> > > > >>
> > > > >>
> > > > >> David Beer wrote:
> > > > >>
> > > > >>> Hi All
> > > > >>>
> > > > >>> I have successsfully set the Schema in the
> > > persistence.xml file. My
> > > > >>> question
> > > > >>> is how do I get the schma auto generated when the table
> > > are generated.
> > > > I
> > > > >>> am
> > > > >>> using the h2 database.
> > > > >>>
> > > > >>> Any guidence would helpful.
> > > > >>>
> > > > >>> Thanks
> > > > >>>
> > > > >>> David
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>
> > > > >>
> > > > >
> > > >
> > >
> >
>

Re: Database Schema Generation

Posted by Miłosz Tylenda <mt...@o2.pl>.
Hi David,

My understanding of the JPA spec is that it does not address database schema generation. I have found the following quote in both JPA 1 and JPA 2 Public Draft:

"It is permitted, but not required, that DDL generation be supported by an implementation of this specification.
Portable applications should not rely upon the use of DDL generation."

So, i would say that the schema tool is an OpenJPA's extension to JPA and the lack of "CREATE SCHEMA" functionality is a limitation in the tool.

Regards,
Milosz


> Hi Milosz
> 
> Thanks for the reply. that is quite annoying. Is this a limitation in the
> openjpa  tool or in JPA? I am just curious as this would speed things up a
> little when testing.
> 
> David
> 
> 2009/2/15 Miłosz Tylenda 
> 
> > David,
> > I am afraid that the schema tool will not create the necessary schemas and
> > you have to do it manually. I had a similar problem with PostgreSQL. This is
> > a quote from the manual:
> > "The schema tool manipulates tables, columns, indexes, constraints, and
> > sequences. It cannot create or drop the database schema objects in which the
> > tables reside, however. If your XML documents refer to named database
> > schemas, those schemas must exist."
> > The only case I am aware of where your example will work is when you use
> > DB2 or Derby - these databases create schemas implicitly when CREATE TABLE
> > refers to them.
> > Greetings,
> > Milosz
> > Hi JudesThanks for the link. I thought I had specified the version in my
> > first e-mail, but here it is I am using openjpa 1.0.1. I have attached both
> > the stack trace and have pasted a snipit of my persistence.xml
> > file.<persistence-unit name="Veilig-Dev-PU"
> > transaction-type="RESOURCE_LOCAL">
> >
> >  <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
> >  <class>veilig.entry.AdditionalInformation</class>
> >  <class>veilig.application.Application</class>
> >  <class>veilig.entry.Entry</class>
> >  <properties>
> >  <property name="openjpa.ConnectionPassword" value="app"/>
> >  <property name="openjpa.ConnectionDriverName"
> > value="org.h2.Driver"/>
> >  <property name="openjpa.ConnectionUserName" value="app"/>
> >  <property name="openjpa.ConnectionURL"
> > value="jdbc:h2:./data/veilig"/>
> >  <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO,
> > Tool=INFO, SQL=TRACE"/>
> >  <!--<property name="openjpa.jdbc.SynchronizeMappings"
> > value="buildSchema(ForeignKeys=true)"/>-->
> >  <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"
> > />
> >  <property name="openjpa.jdbc.Schema" value="Veilig"/>
> >  <property name="openjpa.jdbc.DBDictionary"
> > value="org.apache.openjpa.jdbc.sql.H2Dictionary(useGetObjectForBlobs=false)"/>
> >  </properties>
> >  </persistence-unit>
> > Thanks for your help much apreciated.
> > 2009/2/13 Judes Tumuhairwe <judethecutedude@gmail.com
> > >
> > Hi David,
> > What Martin suggested is right. Just add that *property* element to your
> > persistence-unit in your persistence.xml.
> > <properties>
> > <property name="openjpa.jdbc.SynchronizeMappings"
> > value="buildSchema(SchemaAction=add,deleteTableContents,ForeignKeys=true)"
> > />
> > </properties>
> > No, the properties don't have to appear is a specific order. It's not easy
> > to help you when all we have is "it doesn't seem to work". What version of
> > openJPA are you running, is there a stacktrace, a sample of your
> > persistence.xml, anything at all. Perhaps it is an integration issue.
> > I don't know where the documentation is either but I just googled 'openjpa
> > persistence.xml' & got a complete example of OpenJPA with H2
> > configuration
> > here [1]
> > Does anyone on else know the possible values [chapter 2 (Configuration) of
> > the manual on the website had the properties but doesn't have their
> > possible/legal values]
> > [1] http://www.jpox.org/servlet/forum/viewthread?thread=4188
> > regards,
> > Judes
> > On Thu, Feb 12, 2009 at 2:20 PM, David Beer &
> > lt;david.m.beer@googlemail.com 
> > >wrote:
> > > Hi All
> > >
> > > Can anyone help with this. Is it possible this just doesn't work with
> > the
> > > h2
> > > database or should my persistence.xml file be in a specific order. As
> > in
> > > have the values and properties got to be in a specific order? Is it
> > worth
> > > upgrading to a newer version of openjpa, would this solve my issue?
> > >
> > > David
> > >
> > > 2009/2/10 David Beer <david.m.beer@googlemail.com
> > >
> > >
> > > > Hi Martin
> > > >
> > > > Thanks for your suggestion, I have tried entering the value but
> > it
> > > doesn't
> > > > seem to work. Where did you find the documentation values for
> > > > jdbc.SynchroniseMappings
> > > >
> > > > David
> > > >
> > > > 2009/2/9 Martin Uhlir <stoupa91devel@seznam.cz
> > >
> > > >
> > > >> Hi,
> > > >>
> > > >> put this property into properties list in the persistence.xml
> > > >>
> > > >> <property name="openjpa.jdbc.SynchronizeMappings"
> > > >> value="buildSchema(SchemaAction='add')"/>
> > > >>
> > > >> Martin
> > > >>
> > > >>
> > > >>
> > > >> David Beer wrote:
> > > >>
> > > >>> Hi All
> > > >>>
> > > >>> I have successsfully set the Schema in the
> > persistence.xml file. My
> > > >>> question
> > > >>> is how do I get the schma auto generated when the table
> > are generated.
> > > I
> > > >>> am
> > > >>> using the h2 database.
> > > >>>
> > > >>> Any guidence would helpful.
> > > >>>
> > > >>> Thanks
> > > >>>
> > > >>> David
> > > >>>
> > > >>>
> > > >>>
> > > >>
> > > >>
> > > >
> > >
> >
> 

Re: Database Schema Generation

Posted by David Beer <da...@googlemail.com>.
Hi Milosz

Thanks for the reply. that is quite annoying. Is this a limitation in the
openjpa  tool or in JPA? I am just curious as this would speed things up a
little when testing.

David

2009/2/15 Miłosz Tylenda <mt...@o2.pl>

> David,
> I am afraid that the schema tool will not create the necessary schemas and
> you have to do it manually. I had a similar problem with PostgreSQL. This is
> a quote from the manual:
> "The schema tool manipulates tables, columns, indexes, constraints, and
> sequences. It cannot create or drop the database schema objects in which the
> tables reside, however. If your XML documents refer to named database
> schemas, those schemas must exist."
> The only case I am aware of where your example will work is when you use
> DB2 or Derby - these databases create schemas implicitly when CREATE TABLE
> refers to them.
> Greetings,
> Milosz
> Hi JudesThanks for the link. I thought I had specified the version in my
> first e-mail, but here it is I am using openjpa 1.0.1. I have attached both
> the stack trace and have pasted a snipit of my persistence.xml
> file.&lt;persistence-unit name="Veilig-Dev-PU"
> transaction-type="RESOURCE_LOCAL"&gt;
>
>  &lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt;
>  &lt;class&gt;veilig.entry.AdditionalInformation&lt;/class&gt;
>  &lt;class&gt;veilig.application.Application&lt;/class&gt;
>  &lt;class&gt;veilig.entry.Entry&lt;/class&gt;
>  &lt;properties&gt;
>  &lt;property name="openjpa.ConnectionPassword" value="app"/&gt;
>  &lt;property name="openjpa.ConnectionDriverName"
> value="org.h2.Driver"/&gt;
>  &lt;property name="openjpa.ConnectionUserName" value="app"/&gt;
>  &lt;property name="openjpa.ConnectionURL"
> value="jdbc:h2:./data/veilig"/&gt;
>  &lt;property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO,
> Tool=INFO, SQL=TRACE"/&gt;
>  &lt;!--&lt;property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(ForeignKeys=true)"/&gt;--&gt;
>  &lt;property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"
> /&gt;
>  &lt;property name="openjpa.jdbc.Schema" value="Veilig"/&gt;
>  &lt;property name="openjpa.jdbc.DBDictionary"
> value="org.apache.openjpa.jdbc.sql.H2Dictionary(useGetObjectForBlobs=false)"/&gt;
>  &lt;/properties&gt;
>  &lt;/persistence-unit&gt;
> Thanks for your help much apreciated.
> 2009/2/13 Judes Tumuhairwe &lt;judethecutedude@gmail.com<lt...@gmail.com>
> &gt;
> Hi David,
> What Martin suggested is right. Just add that *property* element to your
> persistence-unit in your persistence.xml.
> &lt;properties&gt;
> &lt;property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(SchemaAction=add,deleteTableContents,ForeignKeys=true)"
> /&gt;
> &lt;/properties&gt;
> No, the properties don't have to appear is a specific order. It's not easy
> to help you when all we have is "it doesn't seem to work". What version of
> openJPA are you running, is there a stacktrace, a sample of your
> persistence.xml, anything at all. Perhaps it is an integration issue.
> I don't know where the documentation is either but I just googled 'openjpa
> persistence.xml' &amp; got a complete example of OpenJPA with H2
> configuration
> here [1]
> Does anyone on else know the possible values [chapter 2 (Configuration) of
> the manual on the website had the properties but doesn't have their
> possible/legal values]
> [1] http://www.jpox.org/servlet/forum/viewthread?thread=4188
> regards,
> Judes
> On Thu, Feb 12, 2009 at 2:20 PM, David Beer &
> lt;david.m.beer@googlemail.com <lt...@googlemail.com>
> &gt;wrote:
> &gt; Hi All
> &gt;
> &gt; Can anyone help with this. Is it possible this just doesn't work with
> the
> &gt; h2
> &gt; database or should my persistence.xml file be in a specific order. As
> in
> &gt; have the values and properties got to be in a specific order? Is it
> worth
> &gt; upgrading to a newer version of openjpa, would this solve my issue?
> &gt;
> &gt; David
> &gt;
> &gt; 2009/2/10 David Beer &lt;david.m.beer@googlemail.com<lt...@googlemail.com>
> &gt;
> &gt;
> &gt; &gt; Hi Martin
> &gt; &gt;
> &gt; &gt; Thanks for your suggestion, I have tried entering the value but
> it
> &gt; doesn't
> &gt; &gt; seem to work. Where did you find the documentation values for
> &gt; &gt; jdbc.SynchroniseMappings
> &gt; &gt;
> &gt; &gt; David
> &gt; &gt;
> &gt; &gt; 2009/2/9 Martin Uhlir &lt;stoupa91devel@seznam.cz<lt...@seznam.cz>
> &gt;
> &gt; &gt;
> &gt; &gt;&gt; Hi,
> &gt; &gt;&gt;
> &gt; &gt;&gt; put this property into properties list in the persistence.xml
> &gt; &gt;&gt;
> &gt; &gt;&gt; &lt;property name="openjpa.jdbc.SynchronizeMappings"
> &gt; &gt;&gt; value="buildSchema(SchemaAction='add')"/&gt;
> &gt; &gt;&gt;
> &gt; &gt;&gt; Martin
> &gt; &gt;&gt;
> &gt; &gt;&gt;
> &gt; &gt;&gt;
> &gt; &gt;&gt; David Beer wrote:
> &gt; &gt;&gt;
> &gt; &gt;&gt;&gt; Hi All
> &gt; &gt;&gt;&gt;
> &gt; &gt;&gt;&gt; I have successsfully set the Schema in the
> persistence.xml file. My
> &gt; &gt;&gt;&gt; question
> &gt; &gt;&gt;&gt; is how do I get the schma auto generated when the table
> are generated.
> &gt; I
> &gt; &gt;&gt;&gt; am
> &gt; &gt;&gt;&gt; using the h2 database.
> &gt; &gt;&gt;&gt;
> &gt; &gt;&gt;&gt; Any guidence would helpful.
> &gt; &gt;&gt;&gt;
> &gt; &gt;&gt;&gt; Thanks
> &gt; &gt;&gt;&gt;
> &gt; &gt;&gt;&gt; David
> &gt; &gt;&gt;&gt;
> &gt; &gt;&gt;&gt;
> &gt; &gt;&gt;&gt;
> &gt; &gt;&gt;
> &gt; &gt;&gt;
> &gt; &gt;
> &gt;
>

Re: Database Schema Generation

Posted by Miłosz Tylenda <mt...@o2.pl>.
David,
I am afraid that the schema tool will not create the necessary schemas and you have to do it manually. I had a similar problem with PostgreSQL. This is a quote from the manual:
"The schema tool manipulates tables, columns, indexes, constraints, and sequences. It cannot create or drop the database schema objects in which the tables reside, however. If your XML documents refer to named database schemas, those schemas must exist."
The only case I am aware of where your example will work is when you use DB2 or Derby - these databases create schemas implicitly when CREATE TABLE refers to them.
Greetings,
Milosz
Hi JudesThanks for the link. I thought I had specified the version in my first e-mail, but here it is I am using openjpa 1.0.1. I have attached both the stack trace and have pasted a snipit of my persistence.xml file.&lt;persistence-unit name="Veilig-Dev-PU" transaction-type="RESOURCE_LOCAL"&gt;
 &lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt;
 &lt;class&gt;veilig.entry.AdditionalInformation&lt;/class&gt;
 &lt;class&gt;veilig.application.Application&lt;/class&gt;
 &lt;class&gt;veilig.entry.Entry&lt;/class&gt;
 &lt;properties&gt;
 &lt;property name="openjpa.ConnectionPassword" value="app"/&gt;
 &lt;property name="openjpa.ConnectionDriverName" value="org.h2.Driver"/&gt;
 &lt;property name="openjpa.ConnectionUserName" value="app"/&gt;
 &lt;property name="openjpa.ConnectionURL" value="jdbc:h2:./data/veilig"/&gt;
 &lt;property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/&gt;
 &lt;!--&lt;property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/&gt;--&gt;
 &lt;property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" /&gt;
 &lt;property name="openjpa.jdbc.Schema" value="Veilig"/&gt;
 &lt;property name="openjpa.jdbc.DBDictionary" value="org.apache.openjpa.jdbc.sql.H2Dictionary(useGetObjectForBlobs=false)"/&gt;
 &lt;/properties&gt;
 &lt;/persistence-unit&gt;
Thanks for your help much apreciated.
2009/2/13 Judes Tumuhairwe &lt;judethecutedude@gmail.com&gt;
Hi David,
What Martin suggested is right. Just add that *property* element to your
persistence-unit in your persistence.xml.
&lt;properties&gt;
&lt;property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(SchemaAction=add,deleteTableContents,ForeignKeys=true)"
/&gt;
&lt;/properties&gt;
No, the properties don't have to appear is a specific order. It's not easy
to help you when all we have is "it doesn't seem to work". What version of
openJPA are you running, is there a stacktrace, a sample of your
persistence.xml, anything at all. Perhaps it is an integration issue.
I don't know where the documentation is either but I just googled 'openjpa
persistence.xml' &amp; got a complete example of OpenJPA with H2 configuration
here [1]
Does anyone on else know the possible values [chapter 2 (Configuration) of
the manual on the website had the properties but doesn't have their
possible/legal values]
[1] http://www.jpox.org/servlet/forum/viewthread?thread=4188
regards,
Judes
On Thu, Feb 12, 2009 at 2:20 PM, David Beer &lt;david.m.beer@googlemail.com&gt;wrote:
&gt; Hi All
&gt;
&gt; Can anyone help with this. Is it possible this just doesn't work with the
&gt; h2
&gt; database or should my persistence.xml file be in a specific order. As in
&gt; have the values and properties got to be in a specific order? Is it worth
&gt; upgrading to a newer version of openjpa, would this solve my issue?
&gt;
&gt; David
&gt;
&gt; 2009/2/10 David Beer &lt;david.m.beer@googlemail.com&gt;
&gt;
&gt; &gt; Hi Martin
&gt; &gt;
&gt; &gt; Thanks for your suggestion, I have tried entering the value but it
&gt; doesn't
&gt; &gt; seem to work. Where did you find the documentation values for
&gt; &gt; jdbc.SynchroniseMappings
&gt; &gt;
&gt; &gt; David
&gt; &gt;
&gt; &gt; 2009/2/9 Martin Uhlir &lt;stoupa91devel@seznam.cz&gt;
&gt; &gt;
&gt; &gt;&gt; Hi,
&gt; &gt;&gt;
&gt; &gt;&gt; put this property into properties list in the persistence.xml
&gt; &gt;&gt;
&gt; &gt;&gt; &lt;property name="openjpa.jdbc.SynchronizeMappings"
&gt; &gt;&gt; value="buildSchema(SchemaAction='add')"/&gt;
&gt; &gt;&gt;
&gt; &gt;&gt; Martin
&gt; &gt;&gt;
&gt; &gt;&gt;
&gt; &gt;&gt;
&gt; &gt;&gt; David Beer wrote:
&gt; &gt;&gt;
&gt; &gt;&gt;&gt; Hi All
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt; I have successsfully set the Schema in the persistence.xml file. My
&gt; &gt;&gt;&gt; question
&gt; &gt;&gt;&gt; is how do I get the schma auto generated when the table are generated.
&gt; I
&gt; &gt;&gt;&gt; am
&gt; &gt;&gt;&gt; using the h2 database.
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt; Any guidence would helpful.
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt; Thanks
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt; David
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;
&gt; &gt;&gt;
&gt; &gt;
&gt;

Re: Database Schema Generation

Posted by David Beer <da...@googlemail.com>.
Hi Judes

Thanks for the link. I thought I had specified the version in my first
e-mail, but here it is I am using openjpa 1.0.1. I have attached both the
stack trace and have pasted a snipit of my persistence.xml file.

<persistence-unit name="Veilig-Dev-PU" transaction-type="RESOURCE_LOCAL">

<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
  <class>veilig.entry.AdditionalInformation</class>
  <class>veilig.application.Application</class>
  <class>veilig.entry.Entry</class>
  <properties>
  <property name="openjpa.ConnectionPassword" value="app"/>
  <property name="openjpa.ConnectionDriverName" value="org.h2.Driver"/>
  <property name="openjpa.ConnectionUserName" value="app"/>
  <property name="openjpa.ConnectionURL" value="jdbc:h2:./data/veilig"/>
  <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO,
Tool=INFO, SQL=TRACE"/>
  <!--<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)"/>-->
  <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
  <property name="openjpa.jdbc.Schema" value="Veilig"/>
  <property name="openjpa.jdbc.DBDictionary"
value="org.apache.openjpa.jdbc.sql.H2Dictionary(useGetObjectForBlobs=false)"/>
  </properties>
  </persistence-unit>

Thanks for your help much apreciated.

2009/2/13 Judes Tumuhairwe <ju...@gmail.com>

> Hi David,
> What Martin suggested is right. Just add that *property* element to your
> persistence-unit in your persistence.xml.
>
> <properties>
>    <property name="openjpa.jdbc.SynchronizeMappings"
>
> value="buildSchema(SchemaAction=add,deleteTableContents,ForeignKeys=true)"
> />
> </properties>
>
> No, the properties don't have to appear is a specific order. It's not easy
> to help you when all we have is "it doesn't seem to work". What version of
> openJPA are you running, is there a stacktrace, a sample of your
> persistence.xml, anything at all. Perhaps it is an integration issue.
>
> I don't know where the documentation is either but I just googled 'openjpa
> persistence.xml' & got a complete example of OpenJPA with H2 configuration
> here [1]
>
> Does anyone on else know the possible values [chapter 2 (Configuration) of
> the manual on the website had the properties but doesn't have their
> possible/legal values]
>
> [1] http://www.jpox.org/servlet/forum/viewthread?thread=4188
>
> regards,
> Judes
>
>
> On Thu, Feb 12, 2009 at 2:20 PM, David Beer <david.m.beer@googlemail.com
> >wrote:
>
> > Hi All
> >
> > Can anyone help with this. Is it possible this just doesn't work with the
> > h2
> > database or should my persistence.xml file be in a specific order. As in
> > have the values and properties got to be in a specific order? Is it worth
> > upgrading to a newer version of openjpa, would this solve my issue?
> >
> > David
> >
> > 2009/2/10 David Beer <da...@googlemail.com>
> >
> > > Hi Martin
> > >
> > > Thanks for your suggestion, I have tried entering the value but it
> > doesn't
> > > seem to work. Where did you find the documentation values for
> > > jdbc.SynchroniseMappings
> > >
> > > David
> > >
> > > 2009/2/9 Martin Uhlir <st...@seznam.cz>
> > >
> > >> Hi,
> > >>
> > >> put this property into properties list in the persistence.xml
> > >>
> > >> <property name="openjpa.jdbc.SynchronizeMappings"
> > >> value="buildSchema(SchemaAction='add')"/>
> > >>
> > >> Martin
> > >>
> > >>
> > >>
> > >> David Beer wrote:
> > >>
> > >>> Hi All
> > >>>
> > >>> I have successsfully set the Schema in the persistence.xml file. My
> > >>> question
> > >>> is how do I get the schma auto generated when the table are
> generated.
> > I
> > >>> am
> > >>> using the h2 database.
> > >>>
> > >>> Any guidence would helpful.
> > >>>
> > >>> Thanks
> > >>>
> > >>> David
> > >>>
> > >>>
> > >>>
> > >>
> > >>
> > >
> >
>

Re: Database Schema Generation

Posted by Judes Tumuhairwe <ju...@gmail.com>.
Hi David,
What Martin suggested is right. Just add that *property* element to your
persistence-unit in your persistence.xml.

<properties>
   <property name="openjpa.jdbc.SynchronizeMappings"

value="buildSchema(SchemaAction=add,deleteTableContents,ForeignKeys=true)"
/>
</properties>

No, the properties don't have to appear is a specific order. It's not easy
to help you when all we have is "it doesn't seem to work". What version of
openJPA are you running, is there a stacktrace, a sample of your
persistence.xml, anything at all. Perhaps it is an integration issue.

I don't know where the documentation is either but I just googled 'openjpa
persistence.xml' & got a complete example of OpenJPA with H2 configuration
here [1]

Does anyone on else know the possible values [chapter 2 (Configuration) of
the manual on the website had the properties but doesn't have their
possible/legal values]

[1] http://www.jpox.org/servlet/forum/viewthread?thread=4188

regards,
Judes


On Thu, Feb 12, 2009 at 2:20 PM, David Beer <da...@googlemail.com>wrote:

> Hi All
>
> Can anyone help with this. Is it possible this just doesn't work with the
> h2
> database or should my persistence.xml file be in a specific order. As in
> have the values and properties got to be in a specific order? Is it worth
> upgrading to a newer version of openjpa, would this solve my issue?
>
> David
>
> 2009/2/10 David Beer <da...@googlemail.com>
>
> > Hi Martin
> >
> > Thanks for your suggestion, I have tried entering the value but it
> doesn't
> > seem to work. Where did you find the documentation values for
> > jdbc.SynchroniseMappings
> >
> > David
> >
> > 2009/2/9 Martin Uhlir <st...@seznam.cz>
> >
> >> Hi,
> >>
> >> put this property into properties list in the persistence.xml
> >>
> >> <property name="openjpa.jdbc.SynchronizeMappings"
> >> value="buildSchema(SchemaAction='add')"/>
> >>
> >> Martin
> >>
> >>
> >>
> >> David Beer wrote:
> >>
> >>> Hi All
> >>>
> >>> I have successsfully set the Schema in the persistence.xml file. My
> >>> question
> >>> is how do I get the schma auto generated when the table are generated.
> I
> >>> am
> >>> using the h2 database.
> >>>
> >>> Any guidence would helpful.
> >>>
> >>> Thanks
> >>>
> >>> David
> >>>
> >>>
> >>>
> >>
> >>
> >
>

Re: Database Schema Generation

Posted by David Beer <da...@googlemail.com>.
Hi All

Can anyone help with this. Is it possible this just doesn't work with the h2
database or should my persistence.xml file be in a specific order. As in
have the values and properties got to be in a specific order? Is it worth
upgrading to a newer version of openjpa, would this solve my issue?

David

2009/2/10 David Beer <da...@googlemail.com>

> Hi Martin
>
> Thanks for your suggestion, I have tried entering the value but it doesn't
> seem to work. Where did you find the documentation values for
> jdbc.SynchroniseMappings
>
> David
>
> 2009/2/9 Martin Uhlir <st...@seznam.cz>
>
>> Hi,
>>
>> put this property into properties list in the persistence.xml
>>
>> <property name="openjpa.jdbc.SynchronizeMappings"
>> value="buildSchema(SchemaAction='add')"/>
>>
>> Martin
>>
>>
>>
>> David Beer wrote:
>>
>>> Hi All
>>>
>>> I have successsfully set the Schema in the persistence.xml file. My
>>> question
>>> is how do I get the schma auto generated when the table are generated. I
>>> am
>>> using the h2 database.
>>>
>>> Any guidence would helpful.
>>>
>>> Thanks
>>>
>>> David
>>>
>>>
>>>
>>
>>
>

Re: Database Schema Generation

Posted by David Beer <da...@googlemail.com>.
Hi Martin

Thanks for your suggestion, I have tried entering the value but it doesn't
seem to work. Where did you find the documentation values for
jdbc.SynchroniseMappings

David

2009/2/9 Martin Uhlir <st...@seznam.cz>

> Hi,
>
> put this property into properties list in the persistence.xml
>
> <property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(SchemaAction='add')"/>
>
> Martin
>
>
>
> David Beer wrote:
>
>> Hi All
>>
>> I have successsfully set the Schema in the persistence.xml file. My
>> question
>> is how do I get the schma auto generated when the table are generated. I
>> am
>> using the h2 database.
>>
>> Any guidence would helpful.
>>
>> Thanks
>>
>> David
>>
>>
>>
>
>

Re: Database Schema Generation

Posted by Martin Uhlir <st...@seznam.cz>.
Hi,

put this property into properties list in the persistence.xml

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

Martin



David Beer wrote:
> Hi All
>
> I have successsfully set the Schema in the persistence.xml file. My question
> is how do I get the schma auto generated when the table are generated. I am
> using the h2 database.
>
> Any guidence would helpful.
>
> Thanks
>
> David
>
>