0

I am trying to use an H2 in memory database to do some testing on my JPA entities. I am still stuck at the point of creating the schema. my persistance unit looks like this

<persistence-unit name="TEST_DS" transaction-type="RESOURCE_LOCAL">

    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>

    <class>com.domain.entities.ThisEntity</class>

    <properties>

        <property name="javax.persistence.jdbc.user" value="sa" />
        <property name="javax.persistence.jdbc.password" value="sa" />
        <property name="openjpa.ConnectionURL" value="jdbc:h2:mem:test2" />
        <property name="openjpa.ConnectionDriverName" value="org.h2.Driver"/>
        <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true,schemaAction='dropDB,add')" />
    </properties>
</persistence-unit>

I have tried various combinations of openjpa & javax.persistance properties without luck.

The exception I get is

org.apache.openjpa.persistence.PersistenceException: Schema "DBM" not found.

The schema exists in my entities

  • Hi, I have already tried that suggestion openjpa.jdbc.SynchronizeMappings will all permutations. It doesn't seems to work – Dieter 'user1027339' Feb 09 '16 at 13:27
  • I admit I've never tried OpenJpa. This SO question has a little more detail: [DDL generation and general persistence.xml settings (OpenJPA)](http://stackoverflow.com/questions/10677950/ddl-generation-and-general-persistence-xml-settings-openjpa) – K.Nicholas Feb 09 '16 at 13:32
  • Thanks for the help. It mostly says the same thing. It's really confusing, as I have created in memory with derby before without issue. I don't mind not using openjpa if that is the issue – Dieter 'user1027339' Feb 09 '16 at 13:43
  • There was a debug setting at the bottom of the last answer, maybe that helps? – K.Nicholas Feb 09 '16 at 13:46

0 Answers0