As stated in the previous answer, there are many possible reasons. One of them is that the table was not created due to syntax incompatibility. If you use specific database provider syntax or a specific feature, HSQLDB does not recognize it . Then, while the create code is executing, you can see that the table has not been created for this syntax reason. For example, if an entity is marked @Column(columnDefinition = "TEXT") creation of the table will fail.
There is a workaround that tells HSQLDB that it should be in compatible mode for pgsl, you should add the url of your connection to this
"spring.datasource.url=jdbc:hsqldb:mem:testdb;sql.syntax_pgs=true"
and for MySQL with
"spring.datasource.url=jdbc:hsqldb:mem:testdb;sql.syntax_mys=true"
oracle
"spring.datasource.url=jdbc:hsqldb:mem:testdb;sql.syntax_ora=true"
note that there is an option, depending on your configuration, it could be hibernate.connection.url= or spring.datasource.url= for those who do not use hibernate schema creation, but the SQL script, you should use this type of syntax in your script
SET DATABASE SQL SYNTAX ORA TRUE;
This will also fix problems due to the specific syntax in the SQL query, such as array_agg for posgresql
Note : the problem occurs very early when the code analyzes the model to create the circuit and then hides in many lines of logs, and then unitTested code crashes with a confusing and incomprehensible exception: "the user lacks privileges or the object was not found error" which does not indicate real problem. Therefore, be sure to read the entire trace from the very beginning and fix all possible problems.
source share