major cleanup to BaseSqmToSqlAstConverter

this class was full of EXTREMELY long methods and lots of typecasts

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-10-20 15:01:10 +02:00
parent 26efd4e530
commit 86db807e22
3 changed files with 976 additions and 1073 deletions

View File

@ -115,7 +115,7 @@ public class MultiTableSqmMutationConverter extends BaseSqmToSqlAstConverter<Sta
return mutatingTableGroup; return mutatingTableGroup;
} }
@Override @Override // promote protected to public
public Stack<SqlAstProcessingState> getProcessingStateStack() { public Stack<SqlAstProcessingState> getProcessingStateStack() {
return super.getProcessingStateStack(); return super.getProcessingStateStack();
} }

View File

@ -48,9 +48,8 @@ public abstract class AbstractSqlAstQueryNodeProcessingStateImpl
public void registerFromUsage(SqmFrom<?, ?> sqmFrom, boolean downgradeTreatUses) { public void registerFromUsage(SqmFrom<?, ?> sqmFrom, boolean downgradeTreatUses) {
if ( !( sqmFrom instanceof SqmTreatedPath<?, ?> ) ) { if ( !( sqmFrom instanceof SqmTreatedPath<?, ?> ) ) {
if ( !sqmFromRegistrations.containsKey( sqmFrom ) ) { if ( !sqmFromRegistrations.containsKey( sqmFrom ) ) {
final SqlAstProcessingState parentState = getParentState(); if ( getParentState() instanceof SqlAstQueryPartProcessingState parentState ) {
if ( parentState instanceof SqlAstQueryPartProcessingState ) { parentState.registerFromUsage( sqmFrom, downgradeTreatUses );
( (SqlAstQueryPartProcessingState) parentState ).registerFromUsage( sqmFrom, downgradeTreatUses );
} }
} }
else { else {