Fix merge checkstyle and compilation errors

This commit is contained in:
Andrea Boriero 2020-04-09 07:37:45 +01:00
parent 5c86c4a805
commit 5d1aea1897
14 changed files with 34 additions and 63 deletions

View File

@ -29,7 +29,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
public @interface Type {
/**
* The Hibernate type name. This should be one of: <ul>
* <li>Registration key for a basic type (see {@link org.hibernate.type.BasicTypeRegistry)}</li>
* <li>Registration key for a basic type (see {@link org.hibernate.type.BasicTypeRegistry})</li>
* <li>Type-definition name (see {@link TypeDef#name()})</li>
* <li>FQN for a {@link org.hibernate.type.Type} implementation class</li>
* <li>FQN for a {@link org.hibernate.usertype.UserType} implementation class</li>

View File

@ -135,7 +135,7 @@ public class SQLServer2005LimitHandler extends AbstractLimitHandler {
/**
* Add any missing aliases to the given {@code select} list, and return
* comma-separated list of all aliases in the list, unless the given list
* contains {@literal *} or {@literal {table.*}, in which case {@literal *}
* contains {@literal *} or {@literal {table.*}}, in which case {@literal *}
* is returned.
*
* @param sql the whole query
@ -144,6 +144,7 @@ public class SQLServer2005LimitHandler extends AbstractLimitHandler {
* @param result a string builder for inserting missing aliases
*
* @return a comma-separated list of aliases, or {@literal *}
*
*/
private String selectAliases(String sql, int afterSelectOffset, int fromOffset, StringBuilder result) {
final List<String> aliases = new LinkedList<>();

View File

@ -106,7 +106,9 @@ public class DialectFactoryImpl implements DialectFactory, ServiceRegistryAwareS
);
}
}
catch (NoSuchMethodException nsme) {}
catch (NoSuchMethodException nsme) {
}
return dialectClass.newInstance();
}
catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {

View File

@ -8,6 +8,6 @@
/**
* This package defines an API for accessing the Hibernate runtime metamodel.
*
* @deprecated (since 6.0) Use Hibernate's mapping model {@link org.hibernate.metamodel.MappingMetamodel}
* deprecated (since 6.0) Use Hibernate's mapping model {@link org.hibernate.metamodel.MappingMetamodel}
*/
package org.hibernate.metadata;

View File

@ -10,7 +10,7 @@ import org.hibernate.query.procedure.ProcedureParameter;
/**
* Describes the function return for ProcedureCalls that represent calls to
* a function ({@code "{? = call ...} syntax) rather that a proc ({@code {call ...} syntax)
* a function ({@code "{? = call ...}} syntax) rather that a proc ({@code {call ...}} syntax)
*
* @author Steve Ebersole
*/

View File

@ -266,7 +266,7 @@ public interface NodeBuilder extends HibernateCriteriaBuilder {
/**
* @implNote Notice that this returns a JPA parameter not the SqmParameter
* @see JpaParameterExpression#
* @see JpaParameterExpression
*
*/
@Override

View File

@ -17,11 +17,12 @@ import org.hibernate.query.NavigablePath;
* The following query is used throughout the javadocs for these impls
* to help describe what it going on and why certain methods do certain things.
*
* ````
*
* ```
* @Entity
* class Person {
* ...
* @ManyToOne(mappedBy="owner")
* @ManyToOne (mappedBy="owner")
* Address getAddress() {...}
* }
*
@ -36,7 +37,8 @@ import org.hibernate.query.NavigablePath;
* join fetch p.address a
* join fetch a.owner o
* join fetch o.address oa
* ````
* ```
*
*
* Here we have one root result and 3 fetches. 2 of the fetches are bi-directional:
*

View File

@ -39,7 +39,8 @@ public interface DomainResultCreationState {
*
* We walk fetches via the SqlAstCreationContext because each "context"
* will define differently what should be fetched (HQL versus load)
*
*/
/*
* todo (6.0) : centralize the implementation of this
* most of the logic in the impls of this is identical. variations include:
* 1) given a Fetchable, determine the FetchTiming and `selected`[1]. Tricky as functional
@ -63,6 +64,6 @@ public interface DomainResultCreationState {
* todo (6.0) : wrt the "trickiness" of `selected[1]`, that may no longer be an issue given how TableGroups
* are built/accessed. Comes down to how we'd know whether to join fetch or select fetch. Simply pass
* along FetchStyle?
*/
*/
List<Fetch> visitFetches(FetchParent fetchParent);
}

View File

@ -18,19 +18,19 @@ import java.util.Objects;
/**
* @asciidoc
*
* ````
* ```
* @Entity
* class MyEntity {
* ...
* @Column( name = "the_column", ... )
* @Column ( name = "the_column", ... )
* public String getTheColumn() { ... }
*
* @Convert( ... )
* @Column( name = "the_column", ... )
* @Convert ( ... )
* @Column ( name = "the_column", ... )
* ConvertedType getTheConvertedColumn() { ... }
*
* }
* ````
* ```
*
* @author Steve Ebersole
*/

View File

@ -106,41 +106,6 @@ public class PaginationTest extends BaseNonConfigCoreFunctionalTestCase {
);
}
/**
* @author <a href="mailto:piotr.findeisen@gmail.com">Piotr Findeisen</a>
*/
@Test
@TestForIssue( jiraKey = "HHH-951" )
@RequiresDialectFeature(
value = DialectChecks.SupportLimitCheck.class,
comment = "Dialect does not support limit"
)
public void testLimitWithExpreesionAndFetchJoin() {
Session session = openSession();
session.beginTransaction();
String hql = "SELECT b, 1 FROM DataMetaPoint b inner join fetch b.dataPoint dp";
session.createQuery(hql)
.setMaxResults(3)
// This should not fail
.list();
HQLQueryPlan queryPlan = new HQLQueryPlan( hql, false, Collections.EMPTY_MAP, sessionFactory());
String sqlQuery = queryPlan.getTranslators()[0]
.collectSqlStrings().get(0);
session.getTransaction().commit();
session.close();
Matcher matcher = Pattern.compile(
"(?is)\\b(?<column>\\w+\\.\\w+)\\s+as\\s+(?<alias>\\w+)\\b.*\\k<column>\\s+as\\s+\\k<alias>")
.matcher(sqlQuery);
if (matcher.find()) {
fail(format("Column %s mapped to alias %s twice in generated SQL: %s", matcher.group("column"),
matcher.group("alias"), sqlQuery));
}
}
@Test
@RequiresDialectFeature(
value = DialectChecks.SupportLimitAndOffsetCheck.class,

View File

@ -23,7 +23,7 @@ import static org.junit.Assert.fail;
public class LimitWithExpreesionAndFetchJoinTest extends BaseNonConfigCoreFunctionalTestCase {
/**
* @author Piotr Findeisen <piotr.findeisen@gmail.com>
* @author Piotr Findeisen
*/
@Test
@TestForIssue( jiraKey = "HHH-951" )

View File

@ -27,13 +27,13 @@ import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.create;
*
* [code]
* .Annotation-driven example
* ````
* ```
*
* @FunctionalSessionFactoryTesting(
* model = @ModelToTest(
* @FunctionalSessionFactoryTesting (
* model = @ModelToTest (
* true, // export
* standardModels = {
* @DomainModel( AvailableDomainModel.CONTACTS )
* @DomainModel ( AvailableDomainModel.CONTACTS )
* },
* annotatedClasses = {
* SomeAdditionalClass.class
@ -52,7 +52,7 @@ import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.create;
*
* }
*
* ````
* ```
*
*
* @see SessionFactoryScope

View File

@ -31,7 +31,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
*
* [source, JAVA, indent=0]
* ----
* @TestDomain( ... )
* @TestDomain ( ... )
* class MyTest implements TestDomainAware {
*
* @Test
@ -55,8 +55,8 @@ import org.junit.jupiter.api.extension.ExtendWith;
*
* [source, JAVA, indent=0]
* ----
* @ServiceRegistry( ... )
* @TestDomain( ... )
* @ServiceRegistry ( ... )
* @TestDomain ( ... )
* class MyTest implements TestDomainAware {
*
* @Test

View File

@ -23,7 +23,7 @@ import org.hibernate.service.spi.ServiceContributor;
*
* [source, JAVA, indent=0]
* ----
* @ServiceRegistry( ... )
* @ServiceRegistry ( ... )
* class MyTest extends ServiceRegistryAware {
* @Test
* public void doTheTest() {
@ -48,8 +48,8 @@ import org.hibernate.service.spi.ServiceContributor;
*
* [source, JAVA, indent=0]
* ----
* @ServiceRegistry( ... )
* @TestDomain( ... )
* @ServiceRegistry ( ... )
* @TestDomain ( ... )
* class MyTest ... {
* }
* ----