title: Generating HSQLDB tables in memory from JPA/EclipseLink (no files)
body: <p>I have JPA2 with EclipseLink 2.4, and I'm trying to implement an in-memory database using HSQLDB. I have been able to create a file implementation of the hsqldb using </p>
  
  <pre><code>jdbc:hsqldb:file:./databases/test;shutdown=true;files_readonly=true
  </code></pre>
  
  <p>But when I try to use <code>jdbc:hsqldb:mem:tableName</code>, I get the following message:</p>
  
  <hr>
  
  <p>Stacktrace:</p>
  
  <pre><code>javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse   
  Persistence Services - 2.4.0.v20120608-r11652):  
    org.eclipse.persistence.exceptions.DatabaseException
  Internal Exception: java.sql.SQLSyntaxErrorException: user lacks privilege or object
    not found: EFFECTIVITY
  
  Error Code: -5501
  Call: INSERT INTO EFFECTIVITY (HULL) VALUES (?)
  bind =&gt; [1 parameter bound]
  Query: InsertObjectQuery(101)
  at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush
         (EntityManagerImpl.java:804)
  at com.gdeb.touchtable.db.TestJPAEntities.testTTTouch(TestJPAEntities.java:93)
  ..............
  Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found:
   EFFECTIVITY
  at org.hsqldb.error.Error.error(Unknown Source)
  at org.hsqldb.error.Error.error(Unknown Source)
  at org.hsqldb.SchemaManager.getTable(Unknown Source)
  at org.hsqldb.ParserDQL.readTableName(Unknown Source)
  at org.hsqldb.ParserDQL.readRangeVariableForDataChange(Unknown Source)
  at org.hsqldb.ParserDML.compileInsertStatement(Unknown Source)
  at org.hsqldb.ParserCommand.compilePart(Unknown Source)
  at org.hsqldb.ParserCommand.compileStatement(Unknown Source)
  at org.hsqldb.Session.compileStatement(Unknown Source)
  at org.hsqldb.StatementManager.compile(Unknown Source)
  at org.hsqldb.Session.execute(Unknown Source)
  ... 63 more
  </code></pre>
  
  <hr>
  
  <p>From what I read, the data model should be generated automagically, but I have only seen examples with Hibernate. Is there a way to link the JPA data-model and create it using the memory mode of HSQLDB?</p>