MSSQL schema & Hibernate 5.1.0.Final (table not found)
<p>I'm trying to understand how to configure my Hibernate to work properly with my MSSQL DB and its schemas.</p>

<p>The problem is that during validation of tables, it logs (for every table): </p>

<pre><code>org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl
- HHH000262: Table not found SHARED_CONFIGURATION
</code></pre>

<p>I debugged Hibernate to find out what causes this and found that it calls something like:</p>

<pre><code>EXECUTE [mydb]..sp_columns N'SHARED_CONFIGURATION',N'',N'mydb'
</code></pre>

<p>Notice that 2nd parameter is schema name and there is passed empty string. When I tried to run this query against DB it returned empty result set. But when I passed 'dbo' as 2nd parameter the result set was not empty (meaning that Hibernate should call this instead).</p>

<p>OK so I was like it seems that I need to define schema. But both setting hibernate.default_schema or setting schema in @Table annotation on my entites threw exception:</p>

<pre><code>Schema-validation: missing table [SHARED_CONFIGURATION]
</code></pre>

<p>So now I'm wondering what is the real problem. I also wanted to set default schema in my DB but was not allowed (Cannot alter the user 'sa', because it does not exist or you do not have permission.) even when executed with user 'sa' itself:</p>

<pre><code>ALTER USER sa WITH DEFAULT_SCHEMA = dbo;
</code></pre>

<p>Note that this happens with any driver (JTDS, official MS driver..) 
Can someone explain what is happening here and how "correctly" get rid of that warning message in log that says table does not exist even when it exists (and application is able to run properly with the database)?</p>