Skip to content

Commit

Permalink
Fix merge checkstyle and compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dreab8 committed Apr 9, 2020
1 parent 5c86c4a commit 5d1aea1
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 63 deletions.
Expand Up @@ -29,7 +29,7 @@
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>
Expand Down
Expand Up @@ -135,7 +135,7 @@ public int bindLimitParametersAtEndOfQuery(RowSelection selection, PreparedState
/**
* 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
Expand All @@ -144,6 +144,7 @@ public int bindLimitParametersAtEndOfQuery(RowSelection selection, PreparedState
* @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<>();
Expand Down
Expand Up @@ -106,7 +106,9 @@ private Dialect constructDialect(Object dialectReference, DialectResolutionInfoS
);
}
}
catch (NoSuchMethodException nsme) {}
catch (NoSuchMethodException nsme) {

}
return dialectClass.newInstance();
}
catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
Expand Down
Expand Up @@ -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;
Expand Up @@ -10,7 +10,7 @@

/**
* 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
*/
Expand Down
Expand Up @@ -266,7 +266,7 @@ default TypeConfiguration getTypeConfiguration() {

/**
* @implNote Notice that this returns a JPA parameter not the SqmParameter
* @see JpaParameterExpression#
* @see JpaParameterExpression
*
*/
@Override
Expand Down
Expand Up @@ -17,11 +17,12 @@
* 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() {...}
* }
*
Expand All @@ -36,7 +37,8 @@
* 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:
*
Expand Down
Expand Up @@ -39,7 +39,8 @@ default ModelPart resolveModelPart(NavigablePath navigablePath) {
*
* 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
Expand All @@ -63,6 +64,6 @@ default ModelPart resolveModelPart(NavigablePath navigablePath) {
* 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);
}
Expand Up @@ -18,19 +18,19 @@
/**
* @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
*/
Expand Down
Expand Up @@ -106,41 +106,6 @@ public void testOffset() {
);
}

/**
* @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,
Expand Down
Expand Up @@ -23,7 +23,7 @@

public class LimitWithExpreesionAndFetchJoinTest extends BaseNonConfigCoreFunctionalTestCase {
/**
* @author Piotr Findeisen <piotr.findeisen@gmail.com>
* @author Piotr Findeisen
*/
@Test
@TestForIssue( jiraKey = "HHH-951" )
Expand Down
Expand Up @@ -27,13 +27,13 @@
*
* [code]
* .Annotation-driven example
* ````
* ```
*
* @FunctionalSessionFactoryTesting(
* model = @ModelToTest(
* @FunctionalSessionFactoryTesting (
* model = @ModelToTest (
* true, // export
* standardModels = {
* @DomainModel( AvailableDomainModel.CONTACTS )
* @DomainModel ( AvailableDomainModel.CONTACTS )
* },
* annotatedClasses = {
* SomeAdditionalClass.class
Expand All @@ -52,7 +52,7 @@
*
* }
*
* ````
* ```
*
*
* @see SessionFactoryScope
Expand Down
Expand Up @@ -31,7 +31,7 @@
*
* [source, JAVA, indent=0]
* ----
* @TestDomain( ... )
* @TestDomain ( ... )
* class MyTest implements TestDomainAware {
*
* @Test
Expand All @@ -55,8 +55,8 @@
*
* [source, JAVA, indent=0]
* ----
* @ServiceRegistry( ... )
* @TestDomain( ... )
* @ServiceRegistry ( ... )
* @TestDomain ( ... )
* class MyTest implements TestDomainAware {
*
* @Test
Expand Down
Expand Up @@ -23,7 +23,7 @@
*
* [source, JAVA, indent=0]
* ----
* @ServiceRegistry( ... )
* @ServiceRegistry ( ... )
* class MyTest extends ServiceRegistryAware {
* @Test
* public void doTheTest() {
Expand All @@ -48,8 +48,8 @@
*
* [source, JAVA, indent=0]
* ----
* @ServiceRegistry( ... )
* @TestDomain( ... )
* @ServiceRegistry ( ... )
* @TestDomain ( ... )
* class MyTest ... {
* }
* ----
Expand Down

0 comments on commit 5d1aea1

Please sign in to comment.