thorough jdoc review and trivial changes to Dialect

This commit is contained in:
Gavin 2023-01-05 01:11:29 +01:00 committed by Gavin King
parent 6f4fe47c54
commit 1fd45b607c
24 changed files with 746 additions and 478 deletions

View File

@ -273,12 +273,12 @@ public class CUBRIDDialect extends Dialect {
@Override
public String getDropForeignKeyString() {
return " drop foreign key ";
return "drop foreign key";
}
@Override
public String getDropUniqueKeyString() {
return " drop index ";
return "drop index";
}
@Override

View File

@ -679,11 +679,6 @@ public class DB2LegacyDialect extends Dialect {
return false;
}
@Override
public boolean supportsParametersInInsertSelect() {
return true;
}
@Override
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
return false;

View File

@ -590,12 +590,6 @@ public class DerbyLegacyDialect extends Dialect {
return true;
}
@Override
public boolean supportsParametersInInsertSelect() {
//TODO: check this
return true;
}
@Override
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
return false;

View File

@ -869,12 +869,12 @@ public class MySQLLegacyDialect extends Dialect {
@Override
public String getDropForeignKeyString() {
return " drop foreign key ";
return "drop foreign key";
}
@Override
public String getDropUniqueKeyString() {
return " drop index ";
return "drop index";
}
@Override

View File

@ -17,6 +17,7 @@ import java.sql.SQLException;
*
* @author Steve Ebersole
*/
@FunctionalInterface
public interface ColumnAliasExtractor {
/**
* Extract the unique column alias.

View File

@ -703,11 +703,6 @@ public class DB2Dialect extends Dialect {
return false;
}
@Override
public boolean supportsParametersInInsertSelect() {
return true;
}
@Override
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
return false;

View File

@ -564,12 +564,6 @@ public class DerbyDialect extends Dialect {
return true;
}
@Override
public boolean supportsParametersInInsertSelect() {
//TODO: check this
return true;
}
@Override
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
return false;

File diff suppressed because it is too large Load Diff

View File

@ -852,12 +852,12 @@ public class MySQLDialect extends Dialect {
@Override
public String getDropForeignKeyString() {
return " drop foreign key ";
return "drop foreign key";
}
@Override
public String getDropUniqueKeyString() {
return " drop index ";
return "drop index";
}
@Override

View File

@ -7,7 +7,7 @@
package org.hibernate.dialect;
/**
* The strategy for rendering which row to lock with the FOR UPDATE OF clause.
* The strategy for rendering which row to lock with the {@code FOR UPDATE OF} clause.
*
* @author Christian Beikov
*/

View File

@ -567,8 +567,8 @@ public class SybaseASEDialect extends SybaseDialect {
@Override
public String getTableTypeString() {
//HHH-7298 I don't know if this would break something or cause some side affects
//but it is required to use 'select for update'
//HHH-7298 I don't know if this would break something or cause
//some side effects, but it is required to use 'select for update'
return " lock datarows";
}

View File

@ -19,7 +19,7 @@ import org.hibernate.engine.jdbc.env.spi.SchemaNameResolver;
import org.jboss.logging.Logger;
/**
* Default implementation
* Default implementation of {@link SchemaNameResolver}.
*
* @author Steve Ebersole
*/

View File

@ -21,7 +21,7 @@ public interface SchemaNameResolver {
* Given a JDBC {@link Connection}, resolve the name of the schema (if one) to which it connects.
*
* @param connection The JDBC connection
* @param dialect The Dialect
* @param dialect The {@link Dialect}
*
* @return The name of the schema (may be null).
*/

View File

@ -22,7 +22,7 @@ import org.hibernate.sql.exec.spi.JdbcOperationQueryCall;
import jakarta.persistence.ParameterMode;
/**
* Standard implementation of CallableStatementSupport
* Standard implementation of {@link org.hibernate.procedure.spi.CallableStatementSupport}.
*
* @author Steve Ebersole
*/

View File

@ -7,25 +7,25 @@
package org.hibernate.query.sqm;
/**
* The kind of fetch to use for the FETCH clause.
* The kind of fetch to use for the {@code FETCH} clause.
*
* @author Christian Beikov
*/
public enum FetchClauseType {
/**
* Exact row count like for LIMIT clause or FETCH FIRST x ROWS ONLY.
* Exact row count like for {@code LIMIT} clause or {@code FETCH FIRST n ROWS ONLY}.
*/
ROWS_ONLY,
/**
* Also fetches ties if the last value is not unique FETCH FIRST x ROWS WITH TIES.
* Also fetches ties if the last value is not unique {@code FETCH FIRST n ROWS WITH TIES}.
*/
ROWS_WITH_TIES,
/**
* Row count in percent FETCH FIRST x PERCENT ROWS ONLY.
* Row count in percent {@code FETCH FIRST n PERCENT ROWS ONLY}.
*/
PERCENT_ONLY,
/**
* Also fetches ties if the last value is not unique FETCH FIRST x PERCENT ROWS WITH TIES.
* Also fetches ties if the last value is not unique {@code FETCH FIRST n PERCENT ROWS WITH TIES}.
*/
PERCENT_WITH_TIES;
}

View File

@ -40,8 +40,10 @@ public class SqmMutationStrategyHelper {
}
/**
* Standard resolution of SqmMutationStrategy to use for a given
* entity hierarchy.
* Standard resolution of {@link SqmMultiTableMutationStrategy} to use for a given entity hierarchy.
*
* @see org.hibernate.dialect.Dialect#getFallbackSqmMutationStrategy
* @see org.hibernate.query.spi.QueryEngineOptions#getCustomSqmMultiTableMutationStrategy
*/
public static SqmMultiTableMutationStrategy resolveStrategy(
RootClass entityBootDescriptor,
@ -61,8 +63,10 @@ public class SqmMutationStrategyHelper {
}
/**
* Standard resolution of SqmInsertStrategy to use for a given
* entity hierarchy.
* Standard resolution of {@link SqmMultiTableInsertStrategy} to use for a given entity hierarchy.
*
* @see org.hibernate.dialect.Dialect#getFallbackSqmInsertStrategy
* @see org.hibernate.query.spi.QueryEngineOptions#getCustomSqmMultiTableInsertStrategy
*/
public static SqmMultiTableInsertStrategy resolveInsertStrategy(
RootClass entityBootDescriptor,

View File

@ -7,7 +7,7 @@
package org.hibernate.query.sqm.mutation.internal.temptable;
/**
* Actions to perform in regards to an temporary table after each use.
* Actions to perform in regard to a temporary table after each use.
*
* @author Steve Ebersole
*/

View File

@ -16,15 +16,17 @@ import org.hibernate.query.sqm.tree.delete.SqmDeleteStatement;
import org.hibernate.query.sqm.tree.update.SqmUpdateStatement;
/**
* Pluggable strategy for defining how mutation (`UPDATE` or `DELETE`) queries should be handled when the target
* entity is mapped to multiple tables via secondary tables or certain inheritance strategies.
*
* Pluggable strategy for defining how mutation ({@code UPDATE} or {@code DELETE}) queries should
* be handled when the target entity is mapped to multiple tables via secondary tables or certain
* inheritance strategies.
* <p>
* The main contracts here are {@link #executeUpdate} and {@link #executeDelete}.
* <p>
* The methods {@link #prepare} and {@link #release} allow the strategy to perform any one time
* preparation and cleanup.
*
* {@link #prepare} and {@link #release} allow the strategy to perform any one time preparation and cleanup.
*
* @apiNote See {@link SqmMutationStrategyHelper#resolveStrategy} for standard resolution of the strategy to use
* for each hierarchy
* @apiNote See {@link SqmMutationStrategyHelper#resolveStrategy} for standard resolution of the
* strategy to use for each hierarchy.
*
* @author Steve Ebersole
*/

View File

@ -6300,9 +6300,7 @@ public abstract class AbstractSqlAstTranslator<T extends JdbcOperation> implemen
@Override
public void visitSqlSelectionExpression(SqlSelectionExpression expression) {
final boolean useSelectionPosition = dialect.supportsOrdinalSelectItemReference();
if ( useSelectionPosition ) {
if ( dialect.supportsOrdinalSelectItemReference() ) {
appendSql( expression.getSelection().getJdbcResultSetIndex() );
}
else {

View File

@ -67,7 +67,8 @@ import static org.hibernate.internal.log.DeprecationLogger.DEPRECATION_LOGGER;
import static org.hibernate.internal.util.NullnessHelper.coalesceSuppliedValues;
/**
* The standard Hibernate implementation for performing schema management.
* The standard Hibernate implementation of {@link SchemaManagementTool}
* for performing schema management.
*
* @author Steve Ebersole
*/

View File

@ -142,7 +142,7 @@ public class StandardForeignKeyExporter implements Exporter<ForeignKey> {
private String getSqlDropStrings(String tableName, ForeignKey foreignKey, Dialect dialect) {
final StringBuilder buf = new StringBuilder( dialect.getAlterTableString( tableName ) );
buf.append( dialect.getDropForeignKeyString() );
buf.append(" ").append( dialect.getDropForeignKeyString() ).append(" ");
if ( dialect.supportsIfExistsBeforeConstraintName() ) {
buf.append( "if exists " );
}

View File

@ -73,8 +73,8 @@ public class ClobJavaType extends AbstractClassJavaType<Clob> {
@Override
public Clob getReplacement(Clob original, Clob target, SharedSessionContractImplementor session) {
return session.getJdbcServices().getJdbcEnvironment().getDialect()
.getLobMergeStrategy().mergeClob( original, target, session );
return session.getJdbcServices().getJdbcEnvironment().getDialect().getLobMergeStrategy()
.mergeClob( original, target, session );
}
@SuppressWarnings("unchecked")

View File

@ -81,7 +81,8 @@ public class NClobJavaType extends AbstractClassJavaType<NClob> {
@Override
public NClob getReplacement(NClob original, NClob target, SharedSessionContractImplementor session) {
return session.getJdbcServices().getJdbcEnvironment().getDialect().getLobMergeStrategy().mergeNClob( original, target, session );
return session.getJdbcServices().getJdbcEnvironment().getDialect().getLobMergeStrategy()
.mergeNClob( original, target, session );
}
@SuppressWarnings("unchecked")

View File

@ -96,7 +96,7 @@ public class ForeignKeyDropTest extends BaseUnitTestCase {
private boolean checkDropForeignKeyConstraint(String tableName) throws IOException {
boolean matches = false;
String regex = getDialect().getAlterTableString( tableName );
regex += getDialect().getDropForeignKeyString();
regex += " " + getDialect().getDropForeignKeyString() + " ";
if ( getDialect().supportsIfExistsBeforeConstraintName() ) {
regex += "if exists ";