openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dyer" <>
Subject Problem using SynchronizeMappings (missing columns)
Date Wed, 12 Dec 2007 01:27:20 GMT
I have an application that was working using Hibernate JPA (standalone,  
not in an EJB container).

I have been trying to convert this to use Open JPA instead.  The  
application uses only JPA annotations (nothing Hibernate-specific).  I  
have managed to fix most of the issues that I have come across but there  
is one thing I am stuck on.  I am trying to get Open JPA to automatically  
create the database tables on application start-up (in the same way that  
the property works).

To achieve this I am using the SycnhronizeMappings property in the  
persistence.xml.  Everything appers to work OK and there are no error  
messages, but when I check the tables in the database (MySQL 5), although  
they have been created, most of the columns are missing.  The only columns  
that are present are the primary keys and most, but not all, of the  
foreign keys.  Simple value columns (e.g. dates and strings mapped with  
@Column) are not there.

This is what my persistence.xml looks like.

<persistence xmlns=""
   <persistence-unit name="myproject">


       <property name="openjpa.ConnectionDriverName"  
value="com.mysql.jdbc.Driver" />
       <property name="openjpa.ConnectionURL"  
value="jdbc:mysql://localhost/myproject" />
       <property name="openjpa.ConnectionUserName" value="myproject" />
       <property name="openjpa.ConnectionPassword" value="myproject" />
       <property name="openjpa.jdbc.SynchronizeMappings"  


I have tried numerous variations on "buildSchema" and its parameters that  
I found on the web, but the result is the same.

Does anybody have any ideas what I'm doing wrong?  Am I wrong to assume  
that SynchronizeMappings is supposed to be equivalent to  I can provide more details if necessary.



Daniel Dyer

View raw message