|
6 | 6 | */
|
7 | 7 | package org.hibernate.query.derived;
|
8 | 8 |
|
| 9 | +import java.util.ArrayList; |
9 | 10 | import java.util.HashSet;
|
10 | 11 | import java.util.List;
|
11 | 12 | import java.util.Map;
|
@@ -67,6 +68,8 @@ public class AnonymousTupleTableGroupProducer implements TableGroupProducer, Map
|
67 | 68 | private final JavaType<?> javaTypeDescriptor;
|
68 | 69 | private final Map<String, ModelPart> modelParts;
|
69 | 70 | private final Set<String> compatibleTableExpressions;
|
| 71 | + private final int jdbcTypeCount; |
| 72 | + private final List<JdbcMapping> jdbcMappings = new ArrayList<>(); |
70 | 73 |
|
71 | 74 | public AnonymousTupleTableGroupProducer(
|
72 | 75 | AnonymousTupleType<?> tupleType,
|
@@ -114,10 +117,14 @@ public AnonymousTupleTableGroupProducer(
|
114 | 117 | );
|
115 | 118 | }
|
116 | 119 | modelParts.put( partName, modelPart );
|
| 120 | + for ( int j = 0; j < modelPart.getJdbcTypeCount(); j++ ) { |
| 121 | + jdbcMappings.add( modelPart.getJdbcMapping( j ) ); |
| 122 | + } |
117 | 123 | selectionIndex += modelPart.getJdbcTypeCount();
|
118 | 124 | }
|
119 | 125 | this.modelParts = modelParts;
|
120 | 126 | this.compatibleTableExpressions = compatibleTableExpressions;
|
| 127 | + jdbcTypeCount = selectionIndex; |
121 | 128 | }
|
122 | 129 |
|
123 | 130 | private ModelPart getModelPart(TableGroup tableGroup) {
|
@@ -368,11 +375,16 @@ public <X, Y> int forEachDisassembledJdbcValue(
|
368 | 375 |
|
369 | 376 | @Override
|
370 | 377 | public JdbcMapping getJdbcMapping(int index) {
|
371 |
| - throw new UnsupportedOperationException( "Not yet implemented" ); |
| 378 | + return jdbcMappings.get( index ); |
372 | 379 | }
|
373 | 380 |
|
374 | 381 | @Override
|
375 | 382 | public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action) {
|
376 | 383 | throw new UnsupportedOperationException( "Not yet implemented" );
|
377 | 384 | }
|
| 385 | + |
| 386 | + @Override |
| 387 | + public int getJdbcTypeCount() { |
| 388 | + return jdbcTypeCount; |
| 389 | + } |
378 | 390 | }
|
0 commit comments