"Table not found" exception with hibernate

The problem is that you think the table exists and that the datasource is correctly configured while Hibernate knows that this isn't correct.

Increase the log levels and use -Dhibernate.show_sql=true to enable logging for SQL statements. That should help to track this one down.

[EDIT] Also make sure you don't have white space before or after a @Table annotation. If you have this annotation:

@Table(name = "myTable ") // Note the space after the name!!

Then Hibernate will use the quoted name to create the table (so you will have a table with the SQL name 'MYTABLE ') but it won't always quote the name when you run queries.


I had the same problem with a view I used in my mapping. After I've disabled Hibernate's validation, it works correctly. Seems, that the validation has a problem with views.


Also make sure the case is correct. You might have it in the databse as dummy_table may be.

Tags:

Hibernate