Skip to content

Commit 613f7ea

Browse files
committed
[HHH-19365]!supportsIdentityColumns
1 parent 680709b commit 613f7ea

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

hibernate-core/src/main/java/org/hibernate/dialect/GaussDBDialect.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import java.util.Map;
1818
import java.util.TimeZone;
1919

20-
import org.checkerframework.checker.nullness.qual.Nullable;
2120
import org.hibernate.Length;
2221
import org.hibernate.LockMode;
2322
import org.hibernate.LockOptions;
@@ -26,13 +25,12 @@
2625
import org.hibernate.boot.model.FunctionContributions;
2726
import org.hibernate.boot.model.TypeContributions;
2827
import org.hibernate.dialect.aggregate.AggregateSupport;
29-
import org.hibernate.dialect.aggregate.GaussDBAggregateSupport;
3028
import org.hibernate.dialect.function.CommonFunctionFactory;
3129
import org.hibernate.dialect.function.GaussDBMinMaxFunction;
3230
import org.hibernate.dialect.function.GaussDBTruncFunction;
3331
import org.hibernate.dialect.function.GaussDBTruncRoundFunction;
34-
import org.hibernate.dialect.identity.IdentityColumnSupport;
3532
import org.hibernate.dialect.identity.GaussDBIdentityColumnSupport;
33+
import org.hibernate.dialect.identity.IdentityColumnSupport;
3634
import org.hibernate.dialect.pagination.LimitHandler;
3735
import org.hibernate.dialect.pagination.OffsetFetchLimitHandler;
3836
import org.hibernate.dialect.sequence.GaussDBSequenceSupport;
@@ -58,11 +56,11 @@
5856
import org.hibernate.procedure.internal.GaussDBCallableStatementSupport;
5957
import org.hibernate.procedure.spi.CallableStatementSupport;
6058
import org.hibernate.query.SemanticException;
59+
import org.hibernate.query.common.FetchClauseType;
60+
import org.hibernate.query.common.TemporalUnit;
6161
import org.hibernate.query.spi.QueryOptions;
6262
import org.hibernate.query.sqm.CastType;
63-
import org.hibernate.query.common.FetchClauseType;
6463
import org.hibernate.query.sqm.IntervalType;
65-
import org.hibernate.query.common.TemporalUnit;
6664
import org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy;
6765
import org.hibernate.query.sqm.mutation.internal.cte.CteMutationStrategy;
6866
import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy;
@@ -100,6 +98,7 @@
10098

10199
import jakarta.persistence.GenerationType;
102100
import jakarta.persistence.TemporalType;
101+
import org.checkerframework.checker.nullness.qual.Nullable;
103102

104103
import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate;
105104
import static org.hibernate.query.common.TemporalUnit.DAY;

hibernate-core/src/main/java/org/hibernate/dialect/function/json/GaussDBJsonExistsFunction.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@
44
*/
55
package org.hibernate.dialect.function.json;
66

7+
import java.util.Iterator;
8+
import java.util.Map;
9+
710
import org.hibernate.metamodel.model.domain.ReturnableType;
811
import org.hibernate.sql.ast.SqlAstTranslator;
912
import org.hibernate.sql.ast.spi.SqlAppender;
1013
import org.hibernate.sql.ast.tree.expression.Expression;
1114
import org.hibernate.sql.ast.tree.expression.JsonPathPassingClause;
1215
import org.hibernate.type.spi.TypeConfiguration;
1316

14-
import java.util.Iterator;
15-
import java.util.Map;
16-
1717

1818
/**
1919
* PostgreSQL json_query function.
2020
*/
2121
public class GaussDBJsonExistsFunction extends JsonExistsFunction {
2222

23-
public GaussDBJsonExistsFunction(TypeConfiguration typeConfiguration,
24-
boolean supportsJsonPathExpression,
25-
boolean supportsJsonPathPassingClause) {
26-
super(typeConfiguration, supportsJsonPathExpression, supportsJsonPathPassingClause);
23+
public GaussDBJsonExistsFunction(
24+
TypeConfiguration typeConfiguration,
25+
boolean supportsJsonPathExpression,
26+
boolean supportsJsonPathPassingClause) {
27+
super( typeConfiguration, supportsJsonPathExpression, supportsJsonPathPassingClause );
2728
}
2829

2930
@Override
@@ -43,11 +44,17 @@ protected void render(
4344
final Map<String, Expression> passingExpressions = passingClause.getPassingExpressions();
4445
final Iterator<Map.Entry<String, Expression>> iterator = passingExpressions.entrySet().iterator();
4546
Map.Entry<String, Expression> entry = iterator.next();
46-
literalValue = literalValue.replace( "$"+entry.getKey(), walker.getLiteralValue( entry.getValue()).toString() );
47+
literalValue = literalValue.replace(
48+
"$" + entry.getKey(),
49+
walker.getLiteralValue( entry.getValue() ).toString()
50+
);
4751
while ( iterator.hasNext() ) {
4852
entry = iterator.next();
4953
sqlAppender.appendSql( ',' );
50-
literalValue = literalValue.replace( "$"+entry.getKey(), walker.getLiteralValue( entry.getValue()).toString() );
54+
literalValue = literalValue.replace(
55+
"$" + entry.getKey(),
56+
walker.getLiteralValue( entry.getValue() ).toString()
57+
);
5158
}
5259
}
5360

hibernate-core/src/test/java/org/hibernate/orm/test/resource/ResultSetReleaseWithStatementDelegationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
import org.hibernate.cfg.AvailableSettings;
1212
import org.hibernate.internal.CoreMessageLogger;
1313
import org.hibernate.resource.jdbc.internal.ResourceRegistryStandardImpl;
14-
import org.hibernate.testing.DialectChecks;
15-
import org.hibernate.testing.RequiresDialectFeature;
1614
import org.hibernate.testing.logger.Triggerable;
15+
import org.hibernate.testing.orm.junit.DialectFeatureChecks;
1716
import org.hibernate.testing.orm.junit.DomainModel;
1817
import org.hibernate.testing.orm.junit.JiraKey;
18+
import org.hibernate.testing.orm.junit.RequiresDialectFeature;
1919
import org.hibernate.testing.orm.junit.ServiceRegistry;
2020
import org.hibernate.testing.orm.junit.SessionFactory;
2121
import org.hibernate.testing.orm.junit.SessionFactoryScope;
@@ -39,7 +39,7 @@
3939
provider = ResultSetReleaseWithStatementDelegationTest.ConnectionProviderDelegateProvider.class)
4040
)
4141
@SessionFactory
42-
@RequiresDialectFeature(DialectChecks.SupportsIdentityColumns.class)
42+
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsIdentityColumns.class)
4343
@JiraKey( "HHH-19280" )
4444
class ResultSetReleaseWithStatementDelegationTest {
4545

0 commit comments

Comments
 (0)