I discovered a weird issue when using HSQLDB as database provider for TopLink JPA.
We need to explicitly include the
toplink.target-database property in the persistence.xml file to make it work.
[sourcecode language="xml"]
[/sourcecode]
Without that, you are most likely to get this error below when you run your application:
[sourcecode language="java"]
Query: DataModifyQuery()
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:304)
...
Caused by: java.sql.SQLException: Table not found in statement
[/sourcecode]
I did not have that property set when I was using TopLink JPA with MySQL so I was a bit surprised why it was not working initially when I switched to HSQLDB.
Anyway, here's the complete properties element of persistence.xml for HSQLDB for your reference:
[sourcecode language="xml"]
[/sourcecode]
Hope I can save you guys a lot of trouble through this post.
Because it certainly took me hours to figure this thing out.