Skip to content

Commit

Permalink
HHH-18170 Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Pelagatti committed May 28, 2024
1 parent d9adb32 commit e65a925
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public static NavigablePath buildSubNavigablePath(NavigablePath lhs, String base
return lhs.append( base, determineAlias( alias ) );
}

public static String getUniqueId() {
public static String acquireUniqueAlias() {
return Long.toString(UNIQUE_ID_COUNTER.incrementAndGet());
}

public static String determineAlias(String alias) {
// Make sure we always create a unique alias, otherwise we might use a wrong table group for the same join
if ( alias == null ) {
return getUniqueId();
return acquireUniqueAlias();
}
else if ( alias == IMPLICIT_ALIAS ) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public EmbeddableValuedExpression(
assert mapping != null;
assert sqlExpression != null;
assert mapping.getEmbeddableTypeDescriptor().getNumberOfAttributeMappings() == sqlExpression.getExpressions().size();
this.navigablePath = baseNavigablePath.append( mapping.getPartName(), SqmCreationHelper.getUniqueId());
this.navigablePath = baseNavigablePath.append( mapping.getPartName(), SqmCreationHelper.acquireUniqueAlias());
this.mapping = mapping;
this.sqlExpression = sqlExpression;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,21 @@ public <X> JpaCteCriteria<X> getCteCriteria(String cteName) {

@Override
public <X> JpaCteCriteria<X> with(AbstractQuery<X> criteria) {
return withInternal( SqmCreationHelper.getUniqueId(), criteria );
return withInternal( SqmCreationHelper.acquireUniqueAlias(), criteria );
}

@Override
public <X> JpaCteCriteria<X> withRecursiveUnionAll(
AbstractQuery<X> baseCriteria,
Function<JpaCteCriteria<X>, AbstractQuery<X>> recursiveCriteriaProducer) {
return withInternal( SqmCreationHelper.getUniqueId(), baseCriteria, false, recursiveCriteriaProducer );
return withInternal( SqmCreationHelper.acquireUniqueAlias(), baseCriteria, false, recursiveCriteriaProducer );
}

@Override
public <X> JpaCteCriteria<X> withRecursiveUnionDistinct(
AbstractQuery<X> baseCriteria,
Function<JpaCteCriteria<X>, AbstractQuery<X>> recursiveCriteriaProducer) {
return withInternal( SqmCreationHelper.getUniqueId(), baseCriteria, true, recursiveCriteriaProducer );
return withInternal( SqmCreationHelper.acquireUniqueAlias(), baseCriteria, true, recursiveCriteriaProducer );
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,21 @@ public <X> JpaCteCriteria<X> getCteCriteria(String cteName) {

@Override
public <X> JpaCteCriteria<X> with(AbstractQuery<X> criteria) {
return withInternal( SqmCreationHelper.getUniqueId(), criteria );
return withInternal( SqmCreationHelper.acquireUniqueAlias(), criteria );
}

@Override
public <X> JpaCteCriteria<X> withRecursiveUnionAll(
AbstractQuery<X> baseCriteria,
Function<JpaCteCriteria<X>, AbstractQuery<X>> recursiveCriteriaProducer) {
return withInternal( SqmCreationHelper.getUniqueId(), baseCriteria, false, recursiveCriteriaProducer );
return withInternal( SqmCreationHelper.acquireUniqueAlias(), baseCriteria, false, recursiveCriteriaProducer );
}

@Override
public <X> JpaCteCriteria<X> withRecursiveUnionDistinct(
AbstractQuery<X> baseCriteria,
Function<JpaCteCriteria<X>, AbstractQuery<X>> recursiveCriteriaProducer) {
return withInternal( SqmCreationHelper.getUniqueId(), baseCriteria, true, recursiveCriteriaProducer );
return withInternal( SqmCreationHelper.acquireUniqueAlias(), baseCriteria, true, recursiveCriteriaProducer );
}

@Override
Expand Down

0 comments on commit e65a925

Please sign in to comment.