diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java index 12157af388..8402cb44a3 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java @@ -61,7 +61,6 @@ import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.tool.schema.extract.spi.ColumnTypeInformation; import org.hibernate.type.JavaObjectType; import org.hibernate.type.descriptor.jdbc.JdbcType; -import org.hibernate.type.descriptor.jdbc.JdbcTypeConstructor; import org.hibernate.type.descriptor.jdbc.ObjectNullAsBinaryTypeJdbcType; import org.hibernate.type.descriptor.jdbc.UUIDJdbcType; import org.hibernate.type.descriptor.jdbc.VarbinaryJdbcType; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialectQueryHints.java b/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialectQueryHints.java index 8f5cbc275d..3cde7bbf84 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialectQueryHints.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialectQueryHints.java @@ -84,7 +84,7 @@ class CockroachDialectQueryHints { StringBuilder buffer = new StringBuilder(); int start = 0; while ( m.find() ) { - buffer.append( query.substring( start, m.start() ) ); + buffer.append(query, start, m.start()); if ( m.group( 1 ) == null ) { buffer.append( " inner" ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2SqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2SqlAstTranslator.java index 6454114eb2..04413b05e6 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2SqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2SqlAstTranslator.java @@ -28,7 +28,6 @@ import org.hibernate.sql.ast.tree.expression.ColumnReference; import org.hibernate.sql.ast.tree.expression.Expression; import org.hibernate.sql.ast.tree.expression.Literal; import org.hibernate.sql.ast.tree.expression.SqlTuple; -import org.hibernate.sql.ast.tree.expression.Summarization; import org.hibernate.sql.ast.tree.from.NamedTableReference; import org.hibernate.sql.ast.tree.from.QueryPartTableReference; import org.hibernate.sql.ast.tree.from.TableGroup; @@ -558,23 +557,6 @@ public class DB2SqlAstTranslator extends AbstractSqlAst emulateSelectTupleComparison( lhsExpressions, tuple.getExpressions(), operator, true ); } - @Override - protected void renderPartitionItem(Expression expression) { - if ( expression instanceof Literal ) { - appendSql( "()" ); - } - else if ( expression instanceof Summarization ) { - Summarization summarization = (Summarization) expression; - appendSql( summarization.getKind().sqlText() ); - appendSql( OPEN_PARENTHESIS ); - renderCommaSeparated( summarization.getGroupings() ); - appendSql( CLOSE_PARENTHESIS ); - } - else { - expression.accept( this ); - } - } - @Override protected boolean supportsRowValueConstructorSyntax() { return false; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2StructJdbcType.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2StructJdbcType.java index b695ef42cd..6588f6a7d4 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2StructJdbcType.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2StructJdbcType.java @@ -31,7 +31,7 @@ import org.hibernate.type.spi.TypeConfiguration; * To support UDTs, we require that a transform exists for the UDT that serializes from SQL to XML * and deserializes to SQL from UDT. This means that from the JDBC perspective, this is an XML type, * but the database models it internally as UDT. - * + *

* The {@link org.hibernate.dialect.aggregate.DB2AggregateSupport} generates the functions and transforms for this * process automatically, but note that all of this is only used for functions and native queries. * By default, we select individual struct parts to avoid the encoding/decoding. diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java index e989ffc6ff..5431004089 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java @@ -131,16 +131,6 @@ public class DB2iDialect extends DB2Dialect { return true; } - @Override - public boolean supportsLateral() { - return true; - } - - @Override - public boolean supportsRecursiveCTE() { - return true; - } - @Override public SqlAstTranslatorFactory getSqlAstTranslatorFactory() { return new StandardSqlAstTranslatorFactory() { diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java index 3bc828a066..b5b4223f65 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java @@ -143,16 +143,6 @@ public class DB2zDialect extends DB2Dialect { return true; } - @Override - public boolean supportsLateral() { - return true; - } - - @Override - public boolean supportsRecursiveCTE() { - return true; - } - @Override public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType) { final StringBuilder pattern = new StringBuilder(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java index 78395be210..d41af872fb 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java @@ -407,7 +407,7 @@ public class DerbyDialect extends Dialect { * no functions at all for calendaring, but we can * emulate the most basic functionality of extract() * using the functions it does have. - * + *

* The only supported {@link TemporalUnit}s are: * {@link TemporalUnit#YEAR}, * {@link TemporalUnit#MONTH} @@ -559,11 +559,6 @@ public class DerbyDialect extends Dialect { return false; } - @Override - public RowLockStrategy getWriteRowLockStrategy() { - return RowLockStrategy.NONE; - } - @Override public RowLockStrategy getReadRowLockStrategy() { return RowLockStrategy.NONE; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DerbySqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/DerbySqlAstTranslator.java index 432f85c764..9dec7ba11d 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DerbySqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DerbySqlAstTranslator.java @@ -183,11 +183,6 @@ public class DerbySqlAstTranslator extends AbstractSqlA } } - @Override - protected String getForUpdate() { - return " for update"; - } - @Override protected String getForShare(int timeoutMillis) { return " for read only"; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java index 1456cf746c..63deeb82fd 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java @@ -179,7 +179,6 @@ import org.hibernate.type.descriptor.jdbc.BlobJdbcType; import org.hibernate.type.descriptor.jdbc.ClobJdbcType; import org.hibernate.type.descriptor.jdbc.JdbcLiteralFormatter; import org.hibernate.type.descriptor.jdbc.JdbcType; -import org.hibernate.type.descriptor.jdbc.JdbcTypeConstructor; import org.hibernate.type.descriptor.jdbc.LongNVarcharJdbcType; import org.hibernate.type.descriptor.jdbc.NCharJdbcType; import org.hibernate.type.descriptor.jdbc.NClobJdbcType; @@ -1588,8 +1587,8 @@ public abstract class Dialect implements ConversionContext, TypeContributor, Fun *

* An implementation may set configuration properties from * {@link #initDefaultProperties()}, though it is discouraged. - * - * @return a set of Hibernate configuration properties + the + * @return the Hibernate configuration properties * * @see #initDefaultProperties() */ @@ -1778,9 +1777,7 @@ public abstract class Dialect implements ConversionContext, TypeContributor, Fun } final JdbcServices jdbcServices = session.getFactory().getFastSessionServices().jdbcServices; try { - final LobCreator lobCreator = jdbcServices.getLobCreator( - session - ); + final LobCreator lobCreator = jdbcServices.getLobCreator( session ); return original == null ? lobCreator.createBlob( ArrayHelper.EMPTY_BYTE_ARRAY ) : lobCreator.createBlob( original.getBinaryStream(), original.length() ); @@ -4575,7 +4572,7 @@ public abstract class Dialect implements ConversionContext, TypeContributor, Fun // Keep this here, rather than moving to Select. // Some Dialects may need the hint to be appended to the very end or beginning // of the finalized SQL statement, so wait until everything is processed. - if ( queryOptions.getDatabaseHints() != null && queryOptions.getDatabaseHints().size() > 0 ) { + if ( queryOptions.getDatabaseHints() != null && !queryOptions.getDatabaseHints().isEmpty() ) { sql = getQueryHintString( sql, queryOptions.getDatabaseHints() ); } if ( commentsEnabled && queryOptions.getComment() != null ) { diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java index 0b7f025f8c..00c760f1ae 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java @@ -63,7 +63,6 @@ import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.sql.model.MutationOperation; import org.hibernate.sql.model.internal.OptionalTableUpdate; -import org.hibernate.sql.model.jdbc.OptionalTableUpdateOperation; import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorLegacyImpl; import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; import org.hibernate.type.descriptor.jdbc.H2FormatJsonJdbcType; @@ -335,11 +334,11 @@ public class H2Dialect extends Dialect { } /** - * H2 requires a very special emulation, because {@code unnest} is pretty much useless, - * due to https://github.com/h2database/h2database/issues/1815. - * This emulation uses {@code array_get}, {@code array_length} and {@code system_range} functions to roughly achieve the same, - * but requires that {@code system_range} is fed with a "maximum array size". - */ + * H2 requires a very special emulation, because {@code unnest} is pretty much useless, + * due to issue 1815. + * This emulation uses {@code array_get}, {@code array_length} and {@code system_range} functions to roughly achieve the same, + * but requires that {@code system_range} is fed with a "maximum array size". + */ protected int getMaximumArraySize() { return 1000; } @@ -954,12 +953,12 @@ public class H2Dialect extends Dialect { return translator.createMergeOperation( optionalTableUpdate ); } - private static MutationOperation withoutMerge( - EntityMutationTarget mutationTarget, - OptionalTableUpdate optionalTableUpdate, - SessionFactoryImplementor factory) { - return new OptionalTableUpdateOperation( mutationTarget, optionalTableUpdate, factory ); - } +// private static MutationOperation withoutMerge( +// EntityMutationTarget mutationTarget, +// OptionalTableUpdate optionalTableUpdate, +// SessionFactoryImplementor factory) { +// return new OptionalTableUpdateOperation( mutationTarget, optionalTableUpdate, factory ); +// } @Override public ParameterMarkerStrategy getNativeParameterMarkerStrategy() { diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/H2SqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/H2SqlAstTranslator.java index 891b4d2cb7..c642e139b0 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/H2SqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/H2SqlAstTranslator.java @@ -17,7 +17,6 @@ import org.hibernate.query.sqm.ComparisonOperator; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.SqlAstNodeRenderingMode; import org.hibernate.sql.ast.spi.SqlSelection; -import org.hibernate.sql.ast.tree.MutationStatement; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.ast.tree.cte.CteContainer; import org.hibernate.sql.ast.tree.cte.CteTableGroup; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/HANASqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/HANASqlAstTranslator.java index f543a4c228..cf579021d1 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/HANASqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/HANASqlAstTranslator.java @@ -8,20 +8,16 @@ package org.hibernate.dialect; import java.util.List; -import org.hibernate.LockMode; import org.hibernate.MappingException; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.internal.util.collections.Stack; import org.hibernate.query.IllegalQueryOperationException; -import org.hibernate.query.sqm.BinaryArithmeticOperator; import org.hibernate.query.sqm.ComparisonOperator; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.SqlAstNodeRenderingMode; import org.hibernate.sql.ast.spi.AbstractSqlAstTranslator; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.ast.tree.cte.CteStatement; -import org.hibernate.sql.ast.tree.delete.DeleteStatement; -import org.hibernate.sql.ast.tree.expression.BinaryArithmeticExpression; import org.hibernate.sql.ast.tree.expression.Expression; import org.hibernate.sql.ast.tree.expression.Literal; import org.hibernate.sql.ast.tree.expression.Summarization; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java index 3eb934cbbc..47fec3e71e 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java @@ -369,11 +369,6 @@ public class HSQLDialect extends Dialect { return false; } - @Override - public String getForUpdateString() { - return " for update"; - } - @Override public LimitHandler getLimitHandler() { return OffsetFetchLimitHandler.INSTANCE; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/HSQLSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/HSQLSqlAstTranslator.java index 18a28a96e4..e651344803 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/HSQLSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/HSQLSqlAstTranslator.java @@ -18,12 +18,10 @@ import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.SqlAstNodeRenderingMode; import org.hibernate.sql.ast.spi.AbstractSqlAstTranslator; import org.hibernate.sql.ast.spi.SqlSelection; -import org.hibernate.sql.ast.tree.MutationStatement; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.ast.tree.expression.BinaryArithmeticExpression; import org.hibernate.sql.ast.tree.expression.CaseSearchedExpression; import org.hibernate.sql.ast.tree.expression.CaseSimpleExpression; -import org.hibernate.sql.ast.tree.expression.ColumnReference; import org.hibernate.sql.ast.tree.expression.Expression; import org.hibernate.sql.ast.tree.expression.Literal; import org.hibernate.sql.ast.tree.expression.SqlTuple; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBDialect.java index f9675b37ee..500ae63483 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBDialect.java @@ -185,11 +185,6 @@ public class MariaDBDialect extends MySQLDialect { return false; } - @Override - protected MySQLStorageEngine getDefaultMySQLStorageEngine() { - return InnoDBStorageEngine.INSTANCE; - } - @Override public boolean supportsIfExistsBeforeConstraintName() { return true; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBSqlAstTranslator.java index d529f6ad3b..357af6b209 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBSqlAstTranslator.java @@ -228,11 +228,6 @@ public class MariaDBSqlAstTranslator extends AbstractSq return useOffsetFetchClause( queryPart ) && getQueryPartForRowNumbering() != queryPart && supportsWindowFunctions() && !isRowsOnlyFetchClauseType( queryPart ); } - @Override - protected boolean supportsSimpleQueryGrouping() { - return true; - } - @Override protected boolean shouldEmulateLateralWithIntersect(QueryPart queryPart) { // Intersect emulation requires nested correlation when no simple query grouping is possible diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleArrayJdbcType.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleArrayJdbcType.java index 12ca68e902..740b028481 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleArrayJdbcType.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleArrayJdbcType.java @@ -35,7 +35,6 @@ import oracle.jdbc.OracleConnection; import static java.sql.Types.ARRAY; import static java.util.Collections.emptySet; -import static org.hibernate.internal.util.collections.ArrayHelper.EMPTY_STRING_ARRAY; /** * Descriptor for {@link Types#ARRAY ARRAY} handling. diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java index 7aa5d3eb3c..7b913b00fc 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java @@ -84,7 +84,6 @@ import org.hibernate.type.descriptor.java.PrimitiveByteArrayJavaType; import org.hibernate.type.descriptor.jdbc.AggregateJdbcType; import org.hibernate.type.descriptor.jdbc.BlobJdbcType; import org.hibernate.type.descriptor.jdbc.JdbcType; -import org.hibernate.type.descriptor.jdbc.JdbcTypeConstructor; import org.hibernate.type.descriptor.jdbc.NullJdbcType; import org.hibernate.type.descriptor.jdbc.ObjectNullAsNullTypeJdbcType; import org.hibernate.type.descriptor.jdbc.OracleJsonBlobJdbcType; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleNestedTableJdbcType.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleNestedTableJdbcType.java index 49af2597f6..2215951754 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleNestedTableJdbcType.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleNestedTableJdbcType.java @@ -35,7 +35,6 @@ import java.util.Locale; import static java.sql.Types.ARRAY; import static java.util.Collections.emptySet; import static org.hibernate.internal.util.StringHelper.truncate; -import static org.hibernate.internal.util.collections.ArrayHelper.EMPTY_STRING_ARRAY; /** * Descriptor for {@link Types#ARRAY ARRAY} handling. @@ -113,13 +112,13 @@ public class OracleNestedTableJdbcType implements JdbcType { @Override protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException { - st.setArray( index, getArray( value, containerJavaType, options ) ); + st.setArray( index, getArray( value, options ) ); } @Override protected void doBind(CallableStatement st, X value, String name, WrapperOptions options) throws SQLException { - final java.sql.Array arr = getArray( value, containerJavaType, options ); + final java.sql.Array arr = getArray( value, options ); try { st.setObject( name, arr, ARRAY ); } @@ -128,7 +127,7 @@ public class OracleNestedTableJdbcType implements JdbcType { } } - private java.sql.Array getArray(X value, BasicPluralJavaType containerJavaType, WrapperOptions options) + private java.sql.Array getArray(X value, WrapperOptions options) throws SQLException { //noinspection unchecked final Class arrayClass = (Class) Array.newInstance( diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLCastingIntervalSecondJdbcType.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLCastingIntervalSecondJdbcType.java index ecaa28ef62..5be4dc1bf5 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLCastingIntervalSecondJdbcType.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLCastingIntervalSecondJdbcType.java @@ -12,7 +12,6 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.sql.ast.SqlAstTranslator; @@ -40,25 +39,17 @@ public class PostgreSQLCastingIntervalSecondJdbcType implements AdjustableJdbcTy @Override public JdbcType resolveIndicatedType(JdbcTypeIndicators indicators, JavaType domainJtd) { - final int scale; - if ( indicators.getColumnScale() == JdbcTypeIndicators.NO_COLUMN_SCALE ) { - scale = domainJtd.getDefaultSqlScale( - indicators.getTypeConfiguration() - .getServiceRegistry() - .getService( JdbcServices.class ) - .getDialect(), - this - ); - } - else { - scale = indicators.getColumnScale(); - } + final int scale = indicators.getColumnScale() == JdbcTypeIndicators.NO_COLUMN_SCALE + ? domainJtd.getDefaultSqlScale( indicators.getDialect(), this ) + : indicators.getColumnScale(); if ( scale > 6 ) { // Since the maximum allowed scale on PostgreSQL is 6 (microsecond precision), // we have to switch to the numeric type if the value is greater return indicators.getTypeConfiguration().getJdbcTypeRegistry().getDescriptor( SqlTypes.NUMERIC ); } - return this; + else { + return this; + } } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java index 4aac1348bb..ac78bb5a24 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java @@ -82,7 +82,6 @@ import org.hibernate.type.descriptor.jdbc.AggregateJdbcType; import org.hibernate.type.descriptor.jdbc.BlobJdbcType; import org.hibernate.type.descriptor.jdbc.ClobJdbcType; import org.hibernate.type.descriptor.jdbc.JdbcType; -import org.hibernate.type.descriptor.jdbc.JdbcTypeConstructor; import org.hibernate.type.descriptor.jdbc.ObjectNullAsBinaryTypeJdbcType; import org.hibernate.type.descriptor.jdbc.XmlJdbcType; import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLUUIDJdbcType.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLUUIDJdbcType.java index 3f2c16111f..8d34222209 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLUUIDJdbcType.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLUUIDJdbcType.java @@ -9,7 +9,6 @@ package org.hibernate.dialect; import java.sql.CallableStatement; import java.sql.PreparedStatement; import java.sql.SQLException; -import java.sql.Types; import java.util.UUID; import org.hibernate.type.descriptor.ValueBinder; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgresPlusDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgresPlusDialect.java index 2769656690..d3ab56df73 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgresPlusDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgresPlusDialect.java @@ -7,7 +7,6 @@ package org.hibernate.dialect; import java.sql.CallableStatement; -import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; @@ -101,12 +100,6 @@ public class PostgresPlusDialect extends PostgreSQLDialect { return col; } - @Override - public ResultSet getResultSet(CallableStatement ps) throws SQLException { - ps.execute(); - return (ResultSet) ps.getObject( 1 ); - } - @Override public String getSelectGUIDString() { return "select uuid_generate_v1"; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java index beec70ab5e..06fe70c1a1 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java @@ -32,9 +32,7 @@ import org.hibernate.dialect.function.SqlServerConvertTruncFunction; import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.identity.SQLServerIdentityColumnSupport; import org.hibernate.dialect.pagination.LimitHandler; -import org.hibernate.dialect.pagination.SQLServer2005LimitHandler; import org.hibernate.dialect.pagination.SQLServer2012LimitHandler; -import org.hibernate.dialect.sequence.NoSequenceSupport; import org.hibernate.dialect.sequence.SQLServer16SequenceSupport; import org.hibernate.dialect.sequence.SQLServerSequenceSupport; import org.hibernate.dialect.sequence.SequenceSupport; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java index 780749142d..e1be71b4a2 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java @@ -16,16 +16,12 @@ import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.query.IllegalQueryOperationException; import org.hibernate.query.sqm.ComparisonOperator; import org.hibernate.query.sqm.FetchClauseType; -import org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor; -import org.hibernate.query.sqm.function.SelfRenderingFunctionSqlAstExpression; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.SqlAstJoinType; import org.hibernate.sql.ast.spi.SqlSelection; -import org.hibernate.sql.ast.tree.MutationStatement; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.ast.tree.delete.DeleteStatement; import org.hibernate.sql.ast.tree.expression.BinaryArithmeticExpression; -import org.hibernate.sql.ast.tree.expression.ColumnReference; import org.hibernate.sql.ast.tree.expression.Expression; import org.hibernate.sql.ast.tree.expression.Literal; import org.hibernate.sql.ast.tree.expression.SqlTuple; @@ -281,7 +277,6 @@ public class SQLServerSqlAstTranslator extends SqlAstTr } protected OffsetFetchClauseMode getOffsetFetchClauseMode(QueryPart queryPart) { - final DatabaseVersion version = getDialect().getVersion(); final boolean hasLimit; final boolean hasOffset; if ( queryPart.isRoot() && hasLimit() ) { @@ -369,11 +364,6 @@ public class SQLServerSqlAstTranslator extends SqlAstTr super.visitSelectClause( selectClause ); } - @Override - protected boolean needsRowsToSkip() { - return false; - } - @Override protected void visitSqlSelections(SelectClause selectClause) { final QuerySpec querySpec = (QuerySpec) getQueryPartStack().getCurrent(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialectTableExporter.java b/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialectTableExporter.java index d1b9ac48f9..5e734f31be 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialectTableExporter.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialectTableExporter.java @@ -55,7 +55,7 @@ class SpannerDialectTableExporter implements Exporter { // a typical table that corresponds to an entity type keyColumns = table.getPrimaryKey().getColumns(); } - else if ( table.getForeignKeys().size() > 0 ) { + else if ( !table.getForeignKeys().isEmpty() ) { // a table with no PK's but has FK's; often corresponds to element collection properties keyColumns = table.getColumns(); } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SpannerSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/SpannerSqlAstTranslator.java index 3aabc748c3..14d22f1931 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SpannerSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SpannerSqlAstTranslator.java @@ -15,7 +15,6 @@ import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.spi.AbstractSqlAstTranslator; import org.hibernate.sql.ast.spi.SqlSelection; import org.hibernate.sql.ast.tree.Statement; -import org.hibernate.sql.ast.tree.cte.CteStatement; import org.hibernate.sql.ast.tree.expression.Expression; import org.hibernate.sql.ast.tree.expression.Literal; import org.hibernate.sql.ast.tree.expression.SqlTuple; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java index 9853ac78ba..5337206ed0 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java @@ -14,7 +14,6 @@ import java.sql.Types; import org.hibernate.LockMode; import org.hibernate.LockOptions; import org.hibernate.boot.model.TypeContributions; -import org.hibernate.cfg.DialectSpecificSettings; import org.hibernate.dialect.pagination.LimitHandler; import org.hibernate.dialect.pagination.TopLimitHandler; import org.hibernate.engine.jdbc.Size; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASESqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASESqlAstTranslator.java index 820c930fe2..c6ed5ec06b 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASESqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASESqlAstTranslator.java @@ -27,7 +27,6 @@ import org.hibernate.sql.ast.tree.expression.BinaryArithmeticExpression; import org.hibernate.sql.ast.tree.expression.CaseSearchedExpression; import org.hibernate.sql.ast.tree.expression.CaseSimpleExpression; import org.hibernate.sql.ast.tree.expression.ColumnReference; -import org.hibernate.sql.ast.tree.expression.AggregateColumnWriteExpression; import org.hibernate.sql.ast.tree.expression.Expression; import org.hibernate.sql.ast.tree.expression.Literal; import org.hibernate.sql.ast.tree.expression.QueryLiteral; @@ -95,19 +94,6 @@ public class SybaseASESqlAstTranslator extends Abstract } } - @Override - protected void renderUpdateClause(UpdateStatement updateStatement) { - appendSql( "update " ); - final Stack clauseStack = getClauseStack(); - try { - clauseStack.push( Clause.UPDATE ); - renderDmlTargetTableExpression( updateStatement.getTargetTable() ); - } - finally { - clauseStack.pop(); - } - } - @Override protected boolean supportsJoinsInDelete() { return true; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java index 0cba4a8f84..81ae3d24ee 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java @@ -40,7 +40,6 @@ import org.hibernate.query.spi.QueryParameterBindings; import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; import org.hibernate.query.sqm.TemporalUnit; -import org.hibernate.query.sqm.TrimSpec; import org.hibernate.query.sqm.internal.DomainParameterXref; import org.hibernate.query.sqm.sql.SqmTranslator; import org.hibernate.query.sqm.sql.SqmTranslatorFactory;