Skip to content

Commit fd7a7c3

Browse files
committed
HHH-19314 Implement AnonymousTupleTableGroupProducer getJdbcTypeCount() and getJdbcMapping(int) methods
1 parent f7fc94c commit fd7a7c3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

hibernate-core/src/main/java/org/hibernate/query/derived/AnonymousTupleTableGroupProducer.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
package org.hibernate.query.derived;
88

9+
import java.util.ArrayList;
910
import java.util.HashSet;
1011
import java.util.List;
1112
import java.util.Map;
@@ -67,6 +68,8 @@ public class AnonymousTupleTableGroupProducer implements TableGroupProducer, Map
6768
private final JavaType<?> javaTypeDescriptor;
6869
private final Map<String, ModelPart> modelParts;
6970
private final Set<String> compatibleTableExpressions;
71+
private final int jdbcTypeCount;
72+
private final List<JdbcMapping> jdbcMappings = new ArrayList<>();
7073

7174
public AnonymousTupleTableGroupProducer(
7275
AnonymousTupleType<?> tupleType,
@@ -114,10 +117,14 @@ public AnonymousTupleTableGroupProducer(
114117
);
115118
}
116119
modelParts.put( partName, modelPart );
120+
for ( int j = 0; j < modelPart.getJdbcTypeCount(); j++ ) {
121+
jdbcMappings.add( modelPart.getJdbcMapping( j ) );
122+
}
117123
selectionIndex += modelPart.getJdbcTypeCount();
118124
}
119125
this.modelParts = modelParts;
120126
this.compatibleTableExpressions = compatibleTableExpressions;
127+
jdbcTypeCount = selectionIndex;
121128
}
122129

123130
private ModelPart getModelPart(TableGroup tableGroup) {
@@ -368,11 +375,16 @@ public <X, Y> int forEachDisassembledJdbcValue(
368375

369376
@Override
370377
public JdbcMapping getJdbcMapping(int index) {
371-
throw new UnsupportedOperationException( "Not yet implemented" );
378+
return jdbcMappings.get( index );
372379
}
373380

374381
@Override
375382
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action) {
376383
throw new UnsupportedOperationException( "Not yet implemented" );
377384
}
385+
386+
@Override
387+
public int getJdbcTypeCount() {
388+
return jdbcTypeCount;
389+
}
378390
}

0 commit comments

Comments
 (0)