-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HHH-17837 HHH-18202 Backport fk rendering-side logic for associations…
… in order/group by
- Loading branch information
Showing
17 changed files
with
303 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmPathVisitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* Hibernate, Relational Persistence for Idiomatic Java | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later | ||
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html | ||
*/ | ||
package org.hibernate.query.sqm.internal; | ||
|
||
import java.util.function.Consumer; | ||
|
||
import org.hibernate.metamodel.model.domain.DiscriminatorSqmPath; | ||
import org.hibernate.metamodel.model.domain.internal.EntityDiscriminatorSqmPath; | ||
import org.hibernate.query.sqm.spi.BaseSemanticQueryWalker; | ||
import org.hibernate.query.sqm.tree.domain.NonAggregatedCompositeSimplePath; | ||
import org.hibernate.query.sqm.tree.domain.SqmAnyValuedSimplePath; | ||
import org.hibernate.query.sqm.tree.domain.SqmBasicValuedSimplePath; | ||
import org.hibernate.query.sqm.tree.domain.SqmEmbeddedValuedSimplePath; | ||
import org.hibernate.query.sqm.tree.domain.SqmEntityValuedSimplePath; | ||
import org.hibernate.query.sqm.tree.domain.SqmPath; | ||
import org.hibernate.query.sqm.tree.domain.SqmPluralValuedSimplePath; | ||
import org.hibernate.query.sqm.tree.domain.SqmTreatedPath; | ||
import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; | ||
|
||
/** | ||
* Generic {@link org.hibernate.query.sqm.SemanticQueryWalker} that applies the provided | ||
* {@link Consumer} to all {@link SqmPath paths} encountered during visitation. | ||
* | ||
* @author Marco Belladelli | ||
*/ | ||
public class SqmPathVisitor extends BaseSemanticQueryWalker { | ||
private final Consumer<SqmPath<?>> pathConsumer; | ||
|
||
public SqmPathVisitor(Consumer<SqmPath<?>> pathConsumer) { | ||
this.pathConsumer = pathConsumer; | ||
} | ||
|
||
@Override | ||
public Object visitBasicValuedPath(SqmBasicValuedSimplePath<?> path) { | ||
pathConsumer.accept( path ); | ||
return path; | ||
} | ||
|
||
@Override | ||
public Object visitEmbeddableValuedPath(SqmEmbeddedValuedSimplePath<?> path) { | ||
pathConsumer.accept( path ); | ||
return path; | ||
} | ||
|
||
@Override | ||
public Object visitEntityValuedPath(SqmEntityValuedSimplePath<?> path) { | ||
pathConsumer.accept( path ); | ||
return path; | ||
} | ||
|
||
@Override | ||
public Object visitAnyValuedValuedPath(SqmAnyValuedSimplePath<?> path) { | ||
pathConsumer.accept( path ); | ||
return path; | ||
} | ||
|
||
@Override | ||
public Object visitQualifiedAttributeJoin(SqmAttributeJoin<?, ?> path) { | ||
pathConsumer.accept( path ); | ||
return path; | ||
} | ||
|
||
@Override | ||
public Object visitTreatedPath(SqmTreatedPath<?, ?> path) { | ||
pathConsumer.accept( path ); | ||
return path; | ||
} | ||
|
||
@Override | ||
public Object visitDiscriminatorPath(EntityDiscriminatorSqmPath path) { | ||
pathConsumer.accept( path ); | ||
return path; | ||
} | ||
|
||
@Override | ||
public Object visitPluralValuedPath(SqmPluralValuedSimplePath<?> path) { | ||
pathConsumer.accept( path ); | ||
return path; | ||
} | ||
|
||
@Override | ||
public Object visitNonAggregatedCompositeValuedPath(NonAggregatedCompositeSimplePath<?> path) { | ||
pathConsumer.accept( path ); | ||
return path; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.