Fix wrong tableExpression and columnExpression value assignment for ColumnConsumer#accept method

This commit is contained in:
Andrea Boriero 2020-03-13 14:17:12 +00:00
parent d88d4a8d7b
commit 5999d80701
18 changed files with 21 additions and 21 deletions

View File

@ -100,7 +100,7 @@ class DatabaseSnapshotExecutor {
final NavigablePath idPath = rootPath.append( EntityIdentifierMapping.ROLE_LOCAL_NAME );
entityDescriptor.getIdentifierMapping().visitColumns(
(col, tab, jdbcMapping) -> {
(tab, col, jdbcMapping) -> {
final TableReference tableReference = rootTableGroup.resolveTableReference( tab );
final JdbcParameter jdbcParameter = new JdbcParameterImpl( jdbcMapping );
@ -146,7 +146,7 @@ class DatabaseSnapshotExecutor {
contributorMapping -> {
rootPath.append( contributorMapping.getAttributeName() );
contributorMapping.visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
final TableReference tableReference = rootTableGroup.resolveTableReference(
containingTableExpression );

View File

@ -319,7 +319,7 @@ public class LoaderSelectBuilder {
final List<ColumnReference> columnReferences = new ArrayList<>( numberOfKeyColumns );
keyPart.visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
final TableReference tableReference = rootTableGroup.resolveTableReference( containingTableExpression );
columnReferences.add(
(ColumnReference) sqlExpressionResolver.resolveSqlExpression(

View File

@ -126,7 +126,7 @@ public class BasicEntityIdentifierMappingImpl implements BasicEntityIdentifierMa
@Override
public void visitColumns(ColumnConsumer consumer) {
consumer.accept( getMappedColumnExpression(), getContainingTableExpression(), getJdbcMapping() );
consumer.accept( getContainingTableExpression(), getMappedColumnExpression(), getJdbcMapping() );
}
@Override

View File

@ -232,6 +232,6 @@ public class BasicValuedSingularAttributeMapping extends AbstractSingularAttribu
@Override
public void visitColumns(ColumnConsumer consumer) {
consumer.accept( mappedColumnExpression, tableExpression, jdbcMapping );
consumer.accept( tableExpression, mappedColumnExpression, jdbcMapping );
}
}

View File

@ -1245,7 +1245,7 @@ public class JoinedSubclassEntityPersister extends AbstractEntityPersister {
() -> columnConsumer -> {
final String[] keyColumnNames = constraintOrderedKeyColumnNames[tablePosition];
for ( String column : keyColumnNames ) {
columnConsumer.accept( column, tableName, null );
columnConsumer.accept( tableName, column, null );
}
}
);

View File

@ -949,7 +949,7 @@ public class SingleTableEntityPersister extends AbstractEntityPersister {
() -> columnConsumer -> {
final String[] keyColumnNames = constraintOrderedKeyColumnNames[tablePosition];
for ( String column : keyColumnNames ) {
columnConsumer.accept( column, tableName, null );
columnConsumer.accept( tableName, column, null );
}
}
);

View File

@ -383,7 +383,7 @@ public class UnionSubclassEntityPersister extends AbstractEntityPersister {
() -> columnConsumer -> {
final String[] keyColumnNames = constraintOrderedKeyColumnNames[tablePosition];
for ( String column : keyColumnNames ) {
columnConsumer.accept( column, tableName, null );
columnConsumer.accept( tableName, column, null );
}
}
);

View File

@ -75,7 +75,7 @@ public class MatchingIdSelectionHelper {
final List<DomainResult> domainResults = new ArrayList<>();
final AtomicInteger i = new AtomicInteger();
targetEntityDescriptor.getIdentifierMapping().visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
final int position = i.getAndIncrement();
final TableReference tableReference = mutatingTableGroup.resolveTableReference( containingTableExpression );
final Expression expression = sqmConverter.getSqlExpressionResolver().resolveSqlExpression(
@ -132,7 +132,7 @@ public class MatchingIdSelectionHelper {
final AtomicInteger i = new AtomicInteger();
targetEntityDescriptor.getIdentifierMapping().visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
final int position = i.getAndIncrement();
final TableReference tableReference = mutatingTableGroup.resolveTableReference( containingTableExpression );
final Expression expression = sqmConverter.getSqlExpressionResolver().resolveSqlExpression(

View File

@ -221,7 +221,7 @@ public class CteDeleteHandler extends AbstractCteMutationHandler implements Dele
final List<ColumnReference> columnsToMatchReferences = new ArrayList<>();
columnsToMatchVisitationSupplier.get().accept(
(columnExpression, containingTableExpression, jdbcMapping) -> columnsToMatchReferences.add(
(containingTableExpression, columnExpression, jdbcMapping) -> columnsToMatchReferences.add(
new ColumnReference(
targetTableReference,
columnExpression,

View File

@ -89,7 +89,7 @@ public final class ExecuteWithIdTableHelper {
final AtomicInteger positionWrapper = new AtomicInteger();
mutatingEntityDescriptor.getIdentifierMapping().visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
final int jdbcPosition = positionWrapper.getAndIncrement();
final TableReference tableReference = mutatingTableGroup.resolveTableReference( containingTableExpression );
matchingIdSelection.getSelectClause().addSqlSelection(

View File

@ -53,7 +53,7 @@ public final class ExecuteWithoutIdTableHelper {
matchingIdSelect.getFromClause().addRoot( matchingIdSelectTableGroup );
rootEntityPersister.getIdentifierMapping().visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
final ColumnReference columnReference = (ColumnReference) sqlExpressionResolver.resolveSqlExpression(
SqlExpressionResolver.createColumnReferenceKey( rootTableReference, columnExpression ),
sqlAstProcessingState -> new ColumnReference(

View File

@ -34,7 +34,7 @@ public class IdTable implements Exportable {
);
entityDescriptor.getIdentifierMapping().visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> columns.add(
(containingTableExpression, columnExpression, jdbcMapping) -> columns.add(
new IdTableColumn(
this,
columnExpression,

View File

@ -269,7 +269,7 @@ public class RestrictedDeleteExecutionDelegate implements TableBasedDeleteHandle
*/
final List<ColumnReference> deletingTableColumnRefs = new ArrayList<>();
tableKeyColumnVisitationSupplier.get().accept(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
assert targetTableReference.getTableExpression().equals( containingTableExpression );
final Expression expression = sqlExpressionResolver.resolveSqlExpression(
@ -439,7 +439,7 @@ public class RestrictedDeleteExecutionDelegate implements TableBasedDeleteHandle
final TableKeyExpressionCollector keyColumnCollector = new TableKeyExpressionCollector( entityDescriptor );
tableKeyColumnVisitationSupplier.get().accept(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
assert containingTableExpression.equals( tableExpression );
keyColumnCollector.apply(
new ColumnReference(

View File

@ -236,7 +236,7 @@ public class UpdateExecutionDelegate implements TableBasedUpdateHandler.Executio
final TableKeyExpressionCollector keyColumnCollector = new TableKeyExpressionCollector( entityDescriptor );
tableKeyColumnVisitationSupplier.get().accept(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
assert containingTableExpression.equals( tableExpression );
keyColumnCollector.apply(
new ColumnReference(

View File

@ -88,7 +88,7 @@ public class DisjunctionRestrictionProducer implements MatchingIdRestrictionProd
final List<ColumnReference> columnReferences = new ArrayList<>( idColumnCount );
final List<JdbcMapping> jdbcMappings = new ArrayList<>( idColumnCount );
identifierMapping.visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
columnReferences.add( new ColumnReference( mutatingTableReference, columnExpression, jdbcMapping, sessionFactory ) );
jdbcMappings.add( jdbcMapping );
}

View File

@ -83,7 +83,7 @@ public class InPredicateRestrictionProducer implements MatchingIdRestrictionProd
final List<ColumnReference> columnReferences = new ArrayList<>( idColumnCount );
final List<JdbcMapping> jdbcMappings = new ArrayList<>( idColumnCount );
identifierMapping.visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
columnReferences.add( new ColumnReference( mutatingTableReference, columnExpression, jdbcMapping, sessionFactory ) );
jdbcMappings.add( jdbcMapping );
}

View File

@ -225,7 +225,7 @@ public class StandardSqmUpdateTranslator
// create one JdbcParameter for each column in the assigned path
assignedPathInterpretation.getExpressionType().visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> {
(containingTableExpression, columnExpression, jdbcMapping) -> {
final JdbcParameter jdbcParameter = new JdbcParameterImpl( jdbcMapping );
jdbcParametersForSqm.add( jdbcParameter );
assignments.add(

View File

@ -46,7 +46,7 @@ public class CteTable {
final int numberOfColumns = entityDescriptor.getIdentifierMapping().getJdbcTypeCount( sessionFactory.getTypeConfiguration() );
cteColumns = new ArrayList<>( numberOfColumns );
entityDescriptor.getIdentifierMapping().visitColumns(
(columnExpression, containingTableExpression, jdbcMapping) -> cteColumns.add(
(containingTableExpression, columnExpression, jdbcMapping) -> cteColumns.add(
new CteColumn(
"cte_" + columnExpression,
jdbcMapping