Fix Sybase Connection#getSchema() throws an exception
This commit is contained in:
parent
c01734adca
commit
aaba4767fe
|
@ -13,6 +13,7 @@ import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
|
|||
import org.hibernate.engine.jdbc.env.spi.IdentifierCaseStrategy;
|
||||
import org.hibernate.engine.jdbc.env.spi.IdentifierHelper;
|
||||
import org.hibernate.engine.jdbc.env.spi.IdentifierHelperBuilder;
|
||||
import org.hibernate.engine.jdbc.env.spi.NameQualifierSupport;
|
||||
import org.hibernate.engine.spi.LoadQueryInfluencers;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.query.CastType;
|
||||
|
@ -287,4 +288,9 @@ public class SybaseDialect extends AbstractTransactSQLDialect {
|
|||
return super.buildIdentifierHelper( builder, dbMetaData );
|
||||
}
|
||||
|
||||
@Override
|
||||
public NameQualifierSupport getNameQualifierSupport() {
|
||||
return NameQualifierSupport.CATALOG;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -406,6 +406,9 @@ public abstract class AbstractInformationExtractorImpl implements InformationExt
|
|||
}
|
||||
|
||||
private Identifier getCurrentSchema(JdbcEnvironment jdbcEnvironment) {
|
||||
if ( jdbcEnvironment.getNameQualifierSupport() == NameQualifierSupport.CATALOG ) {
|
||||
return null;
|
||||
}
|
||||
if ( currentSchema != null ) {
|
||||
return currentSchema;
|
||||
}
|
||||
|
@ -427,6 +430,9 @@ public abstract class AbstractInformationExtractorImpl implements InformationExt
|
|||
}
|
||||
|
||||
private Identifier getCurrentCatalog(JdbcEnvironment jdbcEnvironment) {
|
||||
if ( jdbcEnvironment.getNameQualifierSupport() == NameQualifierSupport.SCHEMA ) {
|
||||
return null;
|
||||
}
|
||||
if ( currentCatalog != null ) {
|
||||
return currentCatalog;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue