HSQL DB in Spring/Hibernate/JPA - unable to change schema

pratapan

I am using HSQL in memory Db for unit testing Java code. Its configured and brought up using Hibernate/JPA/Spring By default its schema is PUBLIC. However the code I am testing has hardcoded schema. So I need to change the schema from PUBLIC to say ABC

I just figure out how to do it. I tried below approaches

  1. CRATE SCHEMA ABC, SET INITIAL SCHEMA ABC

  2. ALTER CATALOG RENAME PUBLIC TO ABC

I get the error 'Schema not found'

That led me to conclude that once setup and started, we cant change the schema. So I tried with configuring schema as a Entity Manager JPA property at env setup. I started getting 'Dependent Bean not found' error for one of the classes in "domain.packages.to.scan"

I searched a lot on the web, I couldnt find definitive answers on how to accomplish this ?

fredt

The simplest way is to rename the PUBLIC schema. Just use the correct syntax from http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#dbc_renaming

ALTER SCHEMA PUBLIC RENAME TO ABC

You can always rename the schema or change to a different schema that you create.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Mongo db array of images change schema

NserviceBus change default db schema for table to create

Connecting to HSQL DB from Spring

How do I change DB schema from dbo to another schema?

HSQL and DBUnit - The given schema 'SA' does not exist

Why is Hibernate adding schema name to Hsql functions?

Best way to create schema in embedded HSQL database

Unable to change column and alter index in pt-online-schema-change

Jooq dynamically change db's schema in generated query

Change db schema or query to return balance for a given period of time

HSQL database occasionally executes schema.sql twice

Will HSQL to H2 Migration solve the issue of unused space in HSQL DB?

How can I turn off logging in HSQL DB with URL parameter?

How to create a HSQL in-memory-db from script file?

Geotools cannot find HSQL EPSG DB, throws error: NoSuchAuthorityCodeException

HSQL DB: is it possible to simulate Oracle IN clause item limit?

flyway hsql db create tables sql migrate hangs

Is it possible to compact an embedded HSQL DB from a Spring Boot application?

Python: HSQL DB remains open after closing? (jaydebeapi)

Representing a DB schema in JSON

Mongo Db schema

DB Schema for translations

Monogo DB Schema

Change schema of dataframe to other schema

How to change room db expected column order? Pre-packaged database has an invalid schema error

Want to change NLS_DATE_FORMAT in oracle DB for a particular Schema only

Prevent schema change from wiping out db of a play framework 2 project

Solr change schema

Detecting schema change in database