From 2748b34a116f47e5a8a280e246d58f303ba6561e Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Thu, 23 May 2019 18:02:10 +0100 Subject: [PATCH] 6 - SQM based on JPA type system --- .../org/hibernate/query/sqm/SqmJoinable.java | 2 ++ .../query/sqm/consume/spi/QuerySplitter.java | 24 +++++-------------- .../tree/domain/AbstractSqmAttributeJoin.java | 2 +- .../tree/domain/AbstractSqmPluralJoin.java | 2 +- .../query/sqm/tree/domain/SqmBagJoin.java | 19 +++++++++++++++ .../query/sqm/tree/domain/SqmListJoin.java | 19 +++++++++++++++ .../query/sqm/tree/domain/SqmMapJoin.java | 14 +++++++++++ .../query/sqm/tree/domain/SqmSetJoin.java | 13 ++++++++++ .../sqm/tree/domain/SqmSingularJoin.java | 19 +++++++++++++++ .../sqm/tree/domain/SqmTreatedBagJoin.java | 7 ++++++ .../sqm/tree/domain/SqmTreatedListJoin.java | 7 ++++++ .../sqm/tree/domain/SqmTreatedMapJoin.java | 11 +++++++++ .../sqm/tree/domain/SqmTreatedSetJoin.java | 7 ++++++ .../tree/domain/SqmTreatedSingularJoin.java | 9 ++++++- 14 files changed, 134 insertions(+), 21 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/SqmJoinable.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/SqmJoinable.java index ffdcc11e62..833436b76d 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/SqmJoinable.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/SqmJoinable.java @@ -26,4 +26,6 @@ public interface SqmJoinable { String alias, boolean fetched, SqmCreationState creationState); + + String getName(); } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/consume/spi/QuerySplitter.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/consume/spi/QuerySplitter.java index 0c0c317bfb..3320313f5f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/consume/spi/QuerySplitter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/consume/spi/QuerySplitter.java @@ -13,7 +13,6 @@ import org.hibernate.NotYetImplementedFor6Exception; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.internal.util.collections.Stack; import org.hibernate.metamodel.model.domain.EntityDomainType; -import org.hibernate.metamodel.model.domain.SingularPersistentAttribute; import org.hibernate.query.NavigablePath; import org.hibernate.query.sqm.produce.SqmCreationProcessingState; import org.hibernate.query.sqm.produce.SqmPathRegistry; @@ -29,7 +28,6 @@ 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.SqmPolymorphicRootDescriptor; -import org.hibernate.query.sqm.tree.domain.SqmSingularJoin; import org.hibernate.query.sqm.tree.expression.SqmBinaryArithmetic; import org.hibernate.query.sqm.tree.expression.SqmExpression; import org.hibernate.query.sqm.tree.expression.SqmLiteral; @@ -37,22 +35,23 @@ import org.hibernate.query.sqm.tree.expression.SqmLiteralEntityType; import org.hibernate.query.sqm.tree.expression.SqmNamedParameter; import org.hibernate.query.sqm.tree.expression.SqmPositionalParameter; import org.hibernate.query.sqm.tree.expression.SqmUnaryOperation; +import org.hibernate.query.sqm.tree.expression.function.SqmFunction; import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.query.sqm.tree.from.SqmCrossJoin; import org.hibernate.query.sqm.tree.from.SqmEntityJoin; import org.hibernate.query.sqm.tree.from.SqmFrom; import org.hibernate.query.sqm.tree.from.SqmFromClause; import org.hibernate.query.sqm.tree.from.SqmRoot; +import org.hibernate.query.sqm.tree.predicate.SqmAndPredicate; +import org.hibernate.query.sqm.tree.predicate.SqmBetweenPredicate; +import org.hibernate.query.sqm.tree.predicate.SqmComparisonPredicate; import org.hibernate.query.sqm.tree.predicate.SqmEmptinessPredicate; +import org.hibernate.query.sqm.tree.predicate.SqmGroupedPredicate; +import org.hibernate.query.sqm.tree.predicate.SqmInSubQueryPredicate; import org.hibernate.query.sqm.tree.predicate.SqmLikePredicate; import org.hibernate.query.sqm.tree.predicate.SqmMemberOfPredicate; import org.hibernate.query.sqm.tree.predicate.SqmNegatedPredicate; import org.hibernate.query.sqm.tree.predicate.SqmNullnessPredicate; -import org.hibernate.query.sqm.tree.predicate.SqmAndPredicate; -import org.hibernate.query.sqm.tree.predicate.SqmBetweenPredicate; -import org.hibernate.query.sqm.tree.predicate.SqmComparisonPredicate; -import org.hibernate.query.sqm.tree.predicate.SqmGroupedPredicate; -import org.hibernate.query.sqm.tree.predicate.SqmInSubQueryPredicate; import org.hibernate.query.sqm.tree.predicate.SqmOrPredicate; import org.hibernate.query.sqm.tree.predicate.SqmPredicate; import org.hibernate.query.sqm.tree.predicate.SqmWhereClause; @@ -72,7 +71,6 @@ import org.hibernate.query.sqm.tree.select.SqmSubQuery; import org.hibernate.query.sqm.tree.update.SqmAssignment; import org.hibernate.query.sqm.tree.update.SqmSetClause; import org.hibernate.query.sqm.tree.update.SqmUpdateStatement; -import org.hibernate.query.sqm.tree.expression.function.SqmFunction; /** * Handles splitting queries containing unmapped polymorphic references. @@ -285,16 +283,6 @@ public class QuerySplitter { join.getNavigablePath(), navigablePath -> { SqmAttributeJoin copy = join.makeCopy(getProcessingStateStack().getCurrent()); -// final SqmAttributeJoin copy = new SqmSingularJoin( -// getProcessingStateStack().getCurrent() -// .getPathRegistry() -// .findFromByPath( join.getLhs().getNavigablePath() ), -// (SingularPersistentAttribute) join.getReferencedPathSource(), -// join.getExplicitAlias(), -// join.getSqmJoinType(), -// join.isFetched(), -// join.nodeBuilder() -// ); sqmFromCopyMap.put( join, copy ); sqmPathCopyMap.put( join.getNavigablePath(), copy ); return copy; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/AbstractSqmAttributeJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/AbstractSqmAttributeJoin.java index 9316532530..b651744790 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/AbstractSqmAttributeJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/AbstractSqmAttributeJoin.java @@ -53,7 +53,7 @@ public abstract class AbstractSqmAttributeJoin //noinspection unchecked super( SqmCreationHelper.buildSubNavigablePath( lhs, joinedNavigable.getName(), alias ), - (SqmPathSource) joinedNavigable, + (SqmPathSource) joinedNavigable, lhs, alias, joinType, diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/AbstractSqmPluralJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/AbstractSqmPluralJoin.java index cf282b4fea..886ba01325 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/AbstractSqmPluralJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/AbstractSqmPluralJoin.java @@ -31,7 +31,7 @@ public abstract class AbstractSqmPluralJoin extends AbstractSqmAttributeJ //noinspection unchecked super( lhs, - (SqmJoinable) joinedNavigable, + joinedNavigable, alias, joinType, fetched, diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBagJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBagJoin.java index bbc1e0d0f1..ce55fbc09d 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBagJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBagJoin.java @@ -21,6 +21,7 @@ import org.hibernate.query.criteria.JpaExpression; import org.hibernate.query.criteria.JpaPredicate; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.sqm.NodeBuilder; +import org.hibernate.query.sqm.produce.SqmCreationProcessingState; import org.hibernate.query.sqm.tree.SqmJoinType; import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.query.sqm.tree.from.SqmFrom; @@ -41,6 +42,12 @@ public class SqmBagJoin extends AbstractSqmPluralJoin, E> super( lhs, attribute, alias, sqmJoinType, fetched, nodeBuilder ); } + @Override + public BagPersistentAttribute getReferencedPathSource() { + //noinspection unchecked + return (BagPersistentAttribute) super.getReferencedPathSource(); + } + @Override public JavaTypeDescriptor getJavaTypeDescriptor() { return getModel().getExpressableJavaTypeDescriptor(); @@ -120,4 +127,16 @@ public class SqmBagJoin extends AbstractSqmPluralJoin, E> //noinspection unchecked return new SqmTreatedBagJoin( this, entityTypeDescriptor, null ); } + + @Override + public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { + return new SqmBagJoin( + creationProcessingState.getPathRegistry().findFromByPath( getLhs().getNavigablePath() ), + getReferencedPathSource(), + getExplicitAlias(), + getSqmJoinType(), + isFetched(), + nodeBuilder() + ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmListJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmListJoin.java index ddb3d88265..73d4e0bc51 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmListJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmListJoin.java @@ -22,6 +22,7 @@ import org.hibernate.query.criteria.JpaListJoin; import org.hibernate.query.criteria.JpaPredicate; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.sqm.NodeBuilder; +import org.hibernate.query.sqm.produce.SqmCreationProcessingState; import org.hibernate.query.sqm.tree.SqmJoinType; import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.query.sqm.tree.from.SqmFrom; @@ -47,6 +48,12 @@ public class SqmListJoin extends AbstractSqmPluralJoin, E> implem return (ListPersistentAttribute) super.getModel(); } + @Override + public ListPersistentAttribute getReferencedPathSource() { + //noinspection unchecked + return (ListPersistentAttribute) super.getReferencedPathSource(); + } + @Override public JavaTypeDescriptor getJavaTypeDescriptor() { return getNodeJavaTypeDescriptor(); @@ -128,4 +135,16 @@ public class SqmListJoin extends AbstractSqmPluralJoin, E> implem public SqmAttributeJoin fetch(String attributeName, JoinType jt) { throw new NotYetImplementedFor6Exception(); } + + @Override + public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { + return new SqmListJoin( + creationProcessingState.getPathRegistry().findFromByPath( getLhs().getNavigablePath() ), + getReferencedPathSource(), + getExplicitAlias(), + getSqmJoinType(), + isFetched(), + nodeBuilder() + ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmMapJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmMapJoin.java index f39fa7abf1..08d3633c14 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmMapJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmMapJoin.java @@ -23,7 +23,9 @@ import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.criteria.PathException; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.SqmPathSource; +import org.hibernate.query.sqm.produce.SqmCreationProcessingState; import org.hibernate.query.sqm.tree.SqmJoinType; +import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.query.sqm.tree.from.SqmFrom; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; @@ -171,4 +173,16 @@ public class SqmMapJoin extends AbstractSqmPluralJoin,V> imple final EntityDomainType targetDescriptor = nodeBuilder().getDomainModel().entity( treatJavaType ); return new SqmTreatedMapJoin( this, targetDescriptor, null ); } + + @Override + public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { + return new SqmMapJoin( + creationProcessingState.getPathRegistry().findFromByPath( getLhs().getNavigablePath() ), + getReferencedPathSource(), + getExplicitAlias(), + getSqmJoinType(), + isFetched(), + nodeBuilder() + ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSetJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSetJoin.java index 3bb48aac0f..6bb209f12a 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSetJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSetJoin.java @@ -21,6 +21,7 @@ import org.hibernate.query.criteria.JpaPredicate; import org.hibernate.query.criteria.JpaSetJoin; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.sqm.NodeBuilder; +import org.hibernate.query.sqm.produce.SqmCreationProcessingState; import org.hibernate.query.sqm.tree.SqmJoinType; import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.query.sqm.tree.from.SqmFrom; @@ -126,4 +127,16 @@ public class SqmSetJoin public SqmAttributeJoin fetch(String attributeName, JoinType jt) { throw new NotYetImplementedFor6Exception(); } + + @Override + public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { + return new SqmSetJoin( + creationProcessingState.getPathRegistry().findFromByPath( getLhs().getNavigablePath() ), + getReferencedPathSource(), + getExplicitAlias(), + getSqmJoinType(), + isFetched(), + nodeBuilder() + ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSingularJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSingularJoin.java index 4d0832cf42..1f386f9f3f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSingularJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSingularJoin.java @@ -12,7 +12,9 @@ import org.hibernate.metamodel.model.domain.EntityDomainType; import org.hibernate.metamodel.model.domain.SingularPersistentAttribute; import org.hibernate.query.criteria.PathException; import org.hibernate.query.sqm.NodeBuilder; +import org.hibernate.query.sqm.produce.SqmCreationProcessingState; import org.hibernate.query.sqm.tree.SqmJoinType; +import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.query.sqm.tree.from.SqmFrom; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; @@ -30,6 +32,11 @@ public class SqmSingularJoin extends AbstractSqmAttributeJoin { super( lhs, joinedNavigable, alias, joinType, fetched, nodeBuilder ); } + @Override + public SingularPersistentAttribute getReferencedPathSource() { + return (SingularPersistentAttribute) super.getReferencedPathSource(); + } + @Override public JavaTypeDescriptor getJavaTypeDescriptor() { return getNodeJavaTypeDescriptor(); @@ -51,4 +58,16 @@ public class SqmSingularJoin extends AbstractSqmAttributeJoin { getReferencedPathSource().getPathName() ); } + + @Override + public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { + return new SqmSingularJoin( + creationProcessingState.getPathRegistry().findFromByPath( getLhs().getNavigablePath() ), + getReferencedPathSource(), + getExplicitAlias(), + getSqmJoinType(), + isFetched(), + nodeBuilder() + ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedBagJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedBagJoin.java index 2e55e36d0b..e88481d131 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedBagJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedBagJoin.java @@ -8,6 +8,8 @@ package org.hibernate.query.sqm.tree.domain; import org.hibernate.metamodel.model.domain.BagPersistentAttribute; import org.hibernate.metamodel.model.domain.EntityDomainType; +import org.hibernate.query.sqm.produce.SqmCreationProcessingState; +import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; /** * @author Steve Ebersole @@ -42,4 +44,9 @@ public class SqmTreatedBagJoin extends SqmBagJoin impleme public EntityDomainType getTreatTarget() { return treatTarget; } + + @Override + public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { + return new SqmTreatedBagJoin( wrappedPath, treatTarget, getAlias() ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedListJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedListJoin.java index 95d81f8a7f..9c66a3a51f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedListJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedListJoin.java @@ -8,8 +8,10 @@ package org.hibernate.query.sqm.tree.domain; import org.hibernate.metamodel.model.domain.EntityDomainType; import org.hibernate.metamodel.model.domain.ListPersistentAttribute; +import org.hibernate.query.sqm.produce.SqmCreationProcessingState; import org.hibernate.query.sqm.produce.spi.SqmCreationState; import org.hibernate.query.sqm.tree.expression.SqmExpression; +import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; /** * @author Steve Ebersole @@ -58,4 +60,9 @@ public class SqmTreatedListJoin extends SqmListJoin imple SqmCreationState creationState) { return getWrappedPath().resolveIndexedAccess( selector, currentContextKey, isTerminal, creationState ); } + + @Override + public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { + return new SqmTreatedListJoin( wrappedPath, treatTarget, getAlias() ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedMapJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedMapJoin.java index 94ab8ea325..eca4a1537d 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedMapJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedMapJoin.java @@ -7,6 +7,8 @@ package org.hibernate.query.sqm.tree.domain; import org.hibernate.metamodel.model.domain.EntityDomainType; +import org.hibernate.query.sqm.produce.SqmCreationProcessingState; +import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; /** @@ -47,4 +49,13 @@ public class SqmTreatedMapJoin extends SqmMapJoin imp public JavaTypeDescriptor getJavaTypeDescriptor() { return null; } + + @Override + public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { + return new SqmTreatedMapJoin( + wrappedPath, + treatTarget, + getAlias() + ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedSetJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedSetJoin.java index 77c198b562..3d26cf67fa 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedSetJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedSetJoin.java @@ -8,6 +8,8 @@ package org.hibernate.query.sqm.tree.domain; import org.hibernate.metamodel.model.domain.EntityDomainType; import org.hibernate.metamodel.model.domain.SetPersistentAttribute; +import org.hibernate.query.sqm.produce.SqmCreationProcessingState; +import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; /** @@ -59,4 +61,9 @@ public class SqmTreatedSetJoin extends SqmSetJoin impleme //noinspection unchecked return (JavaTypeDescriptor) wrappedPath.getJavaTypeDescriptor(); } + + @Override + public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { + return new SqmTreatedSetJoin( wrappedPath, treatTarget, getAlias() ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedSingularJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedSingularJoin.java index c706caa83b..c0980f0aa8 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedSingularJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmTreatedSingularJoin.java @@ -8,6 +8,8 @@ package org.hibernate.query.sqm.tree.domain; import org.hibernate.metamodel.model.domain.EntityDomainType; import org.hibernate.metamodel.model.domain.SingularPersistentAttribute; +import org.hibernate.query.sqm.produce.SqmCreationProcessingState; +import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; /** @@ -48,11 +50,16 @@ public class SqmTreatedSingularJoin extends SqmSingularJoin getJavaTypeDescriptor() { return treatTarget.getExpressableJavaTypeDescriptor(); } + + @Override + public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { + return new SqmTreatedSingularJoin( wrappedPath, treatTarget, getAlias() ); + } }