Skip to content

Commit 6d8137f

Browse files
committed
HHH-18981 Adapt test for ORM 6.6 branch
1 parent c8e8850 commit 6d8137f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

hibernate-core/src/main/java/org/hibernate/dialect/function/array/ArrayAndElementArgumentTypeResolver.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77
package org.hibernate.dialect.function.array;
88

9+
import java.util.List;
10+
911
import org.hibernate.internal.util.collections.ArrayHelper;
1012
import org.hibernate.metamodel.mapping.MappingModelExpressible;
1113
import org.hibernate.metamodel.model.domain.DomainType;
@@ -37,12 +39,13 @@ public MappingModelExpressible<?> resolveFunctionArgumentType(
3739
SqmFunction<?> function,
3840
int argumentIndex,
3941
SqmToSqlAstConverter converter) {
42+
final List<? extends SqmTypedNode<?>> arguments = function.getArguments();
4043
if ( argumentIndex == arrayIndex ) {
4144
for ( int elementIndex : elementIndexes ) {
4245
if ( elementIndex >= arguments.size() ) {
4346
continue;
4447
}
45-
final SqmTypedNode<?> node = function.getArguments().get( elementIndex );
48+
final SqmTypedNode<?> node = arguments.get( elementIndex );
4649
if ( node instanceof SqmExpression<?> ) {
4750
final MappingModelExpressible<?> expressible = converter.determineValueMapping( (SqmExpression<?>) node );
4851
if ( expressible != null ) {
@@ -55,7 +58,7 @@ public MappingModelExpressible<?> resolveFunctionArgumentType(
5558
}
5659
}
5760
else if ( ArrayHelper.contains( elementIndexes, argumentIndex ) ) {
58-
final SqmTypedNode<?> node = function.getArguments().get( arrayIndex );
61+
final SqmTypedNode<?> node = arguments.get( arrayIndex );
5962
if ( node instanceof SqmExpression<?> ) {
6063
final MappingModelExpressible<?> expressible = converter.determineValueMapping( (SqmExpression<?>) node );
6164
if ( expressible != null ) {

hibernate-core/src/test/java/org/hibernate/orm/test/function/array/ArrayToStringWithArrayAggregateTest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
2-
* SPDX-License-Identifier: Apache-2.0
3-
* Copyright Red Hat Inc. and Hibernate Authors
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
46
*/
57
package org.hibernate.orm.test.function.array;
68

@@ -11,8 +13,8 @@
1113
import org.hibernate.query.criteria.JpaCteCriteria;
1214
import org.hibernate.query.criteria.JpaRoot;
1315
import org.hibernate.query.sqm.NodeBuilder;
14-
import org.hibernate.testing.orm.junit.DialectFeatureChecks.SupportsArrayToString;
15-
import org.hibernate.testing.orm.junit.DialectFeatureChecks.SupportsArrayAgg;
16+
17+
import org.hibernate.testing.orm.junit.DialectFeatureChecks;
1618
import org.hibernate.testing.orm.junit.DomainModel;
1719
import org.hibernate.testing.orm.junit.JiraKey;
1820
import org.hibernate.testing.orm.junit.RequiresDialectFeature;
@@ -32,8 +34,7 @@
3234
@DomainModel(
3335
annotatedClasses = {ArrayToStringWithArrayAggregateTest.Book.class, ArrayToStringWithArrayAggregateTest.Dummy.class})
3436
@SessionFactory
35-
@RequiresDialectFeature(feature = SupportsArrayToString.class)
36-
@RequiresDialectFeature(feature = SupportsArrayAgg.class)
37+
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsStructuralArrays.class)
3738
@JiraKey("HHH-18981")
3839
public class ArrayToStringWithArrayAggregateTest {
3940

0 commit comments

Comments
 (0)