Skip to content

HHH-14794 : More changes to support SchemaMigrator/SchemaValidator using Hibernate Reactive #4177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,18 @@ public String getSequenceNextValString(String sequenceName) {
@Override
public String getQuerySequencesString() {
// The upper-case name is necessary here so that both case-sensitive and case-insensitive collations work
return "select * from INFORMATION_SCHEMA.SEQUENCES";

// Internally, SQL server stores start_value, minimum_value, maximum_value, and increment
// in sql_variant columns. SQL Server's JDBC automatically converts these values
// to bigint. Vert.X does support sql_variant columns, so these columns need to be
// explicitly converted here.

return "select sequence_name, sequence_catalog, sequence_schema, " +
"convert( bigint, start_value ) as start_value, " +
"convert( bigint, minimum_value ) as minimum_value, " +
"convert( bigint, maximum_value ) as maximum_value, " +
"convert( bigint, increment ) as increment " +
"from INFORMATION_SCHEMA.SEQUENCES";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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.type.StandardBasicTypes;
import org.hibernate.type.StringType;
import org.hibernate.type.Type;
Expand Down Expand Up @@ -117,6 +118,8 @@ public IdentifierHelper buildIdentifierHelper(
IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException {

if ( dbMetaData == null ) {
// TODO: if DatabaseMetaData != null, unquoted case strategy is set to IdentifierCaseStrategy.UPPER
// Check to see if this setting is correct.
builder.setUnquotedCaseStrategy( IdentifierCaseStrategy.MIXED );
builder.setQuotedCaseStrategy( IdentifierCaseStrategy.MIXED );
}
Expand Down Expand Up @@ -248,4 +251,10 @@ public String getCreateTemporaryTableColumnAnnotation(int sqlTypeCode) {
return "";
}
}

@Override
public NameQualifierSupport getNameQualifierSupport() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that this was missing. Perhaps it deserves its own JIRA so to highlight the change better in changelogs?

return NameQualifierSupport.BOTH;
}

}