Fix merge checkstyle and compilation errors
This commit is contained in:
parent
5c86c4a805
commit
5d1aea1897
|
@ -29,7 +29,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
public @interface Type {
|
public @interface Type {
|
||||||
/**
|
/**
|
||||||
* The Hibernate type name. This should be one of: <ul>
|
* 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>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.type.Type} implementation class</li>
|
||||||
* <li>FQN for a {@link org.hibernate.usertype.UserType} implementation class</li>
|
* <li>FQN for a {@link org.hibernate.usertype.UserType} implementation class</li>
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class SQLServer2005LimitHandler extends AbstractLimitHandler {
|
||||||
/**
|
/**
|
||||||
* Add any missing aliases to the given {@code select} list, and return
|
* 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
|
* 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.
|
* is returned.
|
||||||
*
|
*
|
||||||
* @param sql the whole query
|
* @param sql the whole query
|
||||||
|
@ -144,6 +144,7 @@ public class SQLServer2005LimitHandler extends AbstractLimitHandler {
|
||||||
* @param result a string builder for inserting missing aliases
|
* @param result a string builder for inserting missing aliases
|
||||||
*
|
*
|
||||||
* @return a comma-separated list of aliases, or {@literal *}
|
* @return a comma-separated list of aliases, or {@literal *}
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
private String selectAliases(String sql, int afterSelectOffset, int fromOffset, StringBuilder result) {
|
private String selectAliases(String sql, int afterSelectOffset, int fromOffset, StringBuilder result) {
|
||||||
final List<String> aliases = new LinkedList<>();
|
final List<String> aliases = new LinkedList<>();
|
||||||
|
|
|
@ -106,7 +106,9 @@ public class DialectFactoryImpl implements DialectFactory, ServiceRegistryAwareS
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NoSuchMethodException nsme) {}
|
catch (NoSuchMethodException nsme) {
|
||||||
|
|
||||||
|
}
|
||||||
return dialectClass.newInstance();
|
return dialectClass.newInstance();
|
||||||
}
|
}
|
||||||
catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
|
catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
|
||||||
|
|
|
@ -8,6 +8,6 @@
|
||||||
/**
|
/**
|
||||||
* This package defines an API for accessing the Hibernate runtime metamodel.
|
* 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;
|
package org.hibernate.metadata;
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.hibernate.query.procedure.ProcedureParameter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the function return for ProcedureCalls that represent calls to
|
* 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
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -266,7 +266,7 @@ public interface NodeBuilder extends HibernateCriteriaBuilder {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implNote Notice that this returns a JPA parameter not the SqmParameter
|
* @implNote Notice that this returns a JPA parameter not the SqmParameter
|
||||||
* @see JpaParameterExpression#
|
* @see JpaParameterExpression
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -17,11 +17,12 @@ import org.hibernate.query.NavigablePath;
|
||||||
* The following query is used throughout the javadocs for these impls
|
* 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.
|
* to help describe what it going on and why certain methods do certain things.
|
||||||
*
|
*
|
||||||
* ````
|
*
|
||||||
|
* ```
|
||||||
* @Entity
|
* @Entity
|
||||||
* class Person {
|
* class Person {
|
||||||
* ...
|
* ...
|
||||||
* @ManyToOne(mappedBy="owner")
|
* @ManyToOne (mappedBy="owner")
|
||||||
* Address getAddress() {...}
|
* Address getAddress() {...}
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
|
@ -36,7 +37,8 @@ import org.hibernate.query.NavigablePath;
|
||||||
* join fetch p.address a
|
* join fetch p.address a
|
||||||
* join fetch a.owner o
|
* join fetch a.owner o
|
||||||
* join fetch o.address oa
|
* join fetch o.address oa
|
||||||
* ````
|
* ```
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* Here we have one root result and 3 fetches. 2 of the fetches are bi-directional:
|
* Here we have one root result and 3 fetches. 2 of the fetches are bi-directional:
|
||||||
*
|
*
|
||||||
|
|
|
@ -39,7 +39,8 @@ public interface DomainResultCreationState {
|
||||||
*
|
*
|
||||||
* We walk fetches via the SqlAstCreationContext because each "context"
|
* We walk fetches via the SqlAstCreationContext because each "context"
|
||||||
* will define differently what should be fetched (HQL versus load)
|
* will define differently what should be fetched (HQL versus load)
|
||||||
*
|
*/
|
||||||
|
/*
|
||||||
* todo (6.0) : centralize the implementation of this
|
* todo (6.0) : centralize the implementation of this
|
||||||
* most of the logic in the impls of this is identical. variations include:
|
* 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
|
* 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
|
* 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
|
* are built/accessed. Comes down to how we'd know whether to join fetch or select fetch. Simply pass
|
||||||
* along FetchStyle?
|
* along FetchStyle?
|
||||||
*/
|
*/
|
||||||
List<Fetch> visitFetches(FetchParent fetchParent);
|
List<Fetch> visitFetches(FetchParent fetchParent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,19 +18,19 @@ import java.util.Objects;
|
||||||
/**
|
/**
|
||||||
* @asciidoc
|
* @asciidoc
|
||||||
*
|
*
|
||||||
* ````
|
* ```
|
||||||
* @Entity
|
* @Entity
|
||||||
* class MyEntity {
|
* class MyEntity {
|
||||||
* ...
|
* ...
|
||||||
* @Column( name = "the_column", ... )
|
* @Column ( name = "the_column", ... )
|
||||||
* public String getTheColumn() { ... }
|
* public String getTheColumn() { ... }
|
||||||
*
|
*
|
||||||
* @Convert( ... )
|
* @Convert ( ... )
|
||||||
* @Column( name = "the_column", ... )
|
* @Column ( name = "the_column", ... )
|
||||||
* ConvertedType getTheConvertedColumn() { ... }
|
* ConvertedType getTheConvertedColumn() { ... }
|
||||||
*
|
*
|
||||||
* }
|
* }
|
||||||
* ````
|
* ```
|
||||||
*
|
*
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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
|
@Test
|
||||||
@RequiresDialectFeature(
|
@RequiresDialectFeature(
|
||||||
value = DialectChecks.SupportLimitAndOffsetCheck.class,
|
value = DialectChecks.SupportLimitAndOffsetCheck.class,
|
||||||
|
|
|
@ -23,7 +23,7 @@ import static org.junit.Assert.fail;
|
||||||
|
|
||||||
public class LimitWithExpreesionAndFetchJoinTest extends BaseNonConfigCoreFunctionalTestCase {
|
public class LimitWithExpreesionAndFetchJoinTest extends BaseNonConfigCoreFunctionalTestCase {
|
||||||
/**
|
/**
|
||||||
* @author Piotr Findeisen <piotr.findeisen@gmail.com>
|
* @author Piotr Findeisen
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@TestForIssue( jiraKey = "HHH-951" )
|
@TestForIssue( jiraKey = "HHH-951" )
|
||||||
|
|
|
@ -27,13 +27,13 @@ import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.create;
|
||||||
*
|
*
|
||||||
* [code]
|
* [code]
|
||||||
* .Annotation-driven example
|
* .Annotation-driven example
|
||||||
* ````
|
* ```
|
||||||
*
|
*
|
||||||
* @FunctionalSessionFactoryTesting(
|
* @FunctionalSessionFactoryTesting (
|
||||||
* model = @ModelToTest(
|
* model = @ModelToTest (
|
||||||
* true, // export
|
* true, // export
|
||||||
* standardModels = {
|
* standardModels = {
|
||||||
* @DomainModel( AvailableDomainModel.CONTACTS )
|
* @DomainModel ( AvailableDomainModel.CONTACTS )
|
||||||
* },
|
* },
|
||||||
* annotatedClasses = {
|
* annotatedClasses = {
|
||||||
* SomeAdditionalClass.class
|
* SomeAdditionalClass.class
|
||||||
|
@ -52,7 +52,7 @@ import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.create;
|
||||||
*
|
*
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* ````
|
* ```
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @see SessionFactoryScope
|
* @see SessionFactoryScope
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
*
|
*
|
||||||
* [source, JAVA, indent=0]
|
* [source, JAVA, indent=0]
|
||||||
* ----
|
* ----
|
||||||
* @TestDomain( ... )
|
* @TestDomain ( ... )
|
||||||
* class MyTest implements TestDomainAware {
|
* class MyTest implements TestDomainAware {
|
||||||
*
|
*
|
||||||
* @Test
|
* @Test
|
||||||
|
@ -55,8 +55,8 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
*
|
*
|
||||||
* [source, JAVA, indent=0]
|
* [source, JAVA, indent=0]
|
||||||
* ----
|
* ----
|
||||||
* @ServiceRegistry( ... )
|
* @ServiceRegistry ( ... )
|
||||||
* @TestDomain( ... )
|
* @TestDomain ( ... )
|
||||||
* class MyTest implements TestDomainAware {
|
* class MyTest implements TestDomainAware {
|
||||||
*
|
*
|
||||||
* @Test
|
* @Test
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.hibernate.service.spi.ServiceContributor;
|
||||||
*
|
*
|
||||||
* [source, JAVA, indent=0]
|
* [source, JAVA, indent=0]
|
||||||
* ----
|
* ----
|
||||||
* @ServiceRegistry( ... )
|
* @ServiceRegistry ( ... )
|
||||||
* class MyTest extends ServiceRegistryAware {
|
* class MyTest extends ServiceRegistryAware {
|
||||||
* @Test
|
* @Test
|
||||||
* public void doTheTest() {
|
* public void doTheTest() {
|
||||||
|
@ -48,8 +48,8 @@ import org.hibernate.service.spi.ServiceContributor;
|
||||||
*
|
*
|
||||||
* [source, JAVA, indent=0]
|
* [source, JAVA, indent=0]
|
||||||
* ----
|
* ----
|
||||||
* @ServiceRegistry( ... )
|
* @ServiceRegistry ( ... )
|
||||||
* @TestDomain( ... )
|
* @TestDomain ( ... )
|
||||||
* class MyTest ... {
|
* class MyTest ... {
|
||||||
* }
|
* }
|
||||||
* ----
|
* ----
|
||||||
|
|
Loading…
Reference in New Issue