When using embedded HSQLDB to unit test, it seems the schema and/or the catalog defined in the hibernate entity mapping file can't be handled correctly. The hibernate mapping looks like
<class name="ca.zl.Orders" table="Orders" schema="dbo" catalog="db1">
With the property "hibernate.connection.url" set to "jdbc:hsqldb:mem:db1", I always got the following errors
org.hibernate.tool.hbm2ddl.SchemaExport: user lacks privilege or object not found: DB1 org.hibernate.tool.hbm2ddl.SchemaExport: invalid schema name: DBO
This seems caused by HSQLDB by default only has one catalog named "PUBLIC", see document here.
I can't change the hibernate entity mapping, I don't want to use other database engine (I know H2DB can handle this). Can anyone shed a light on how to make HSQLDB work in this unit test context?
create schema db1
?ALTER CATALOG PUBLIC RENAME TO DB1