diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyLegacySqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyLegacySqlAstTranslator.java index a17629b0c1..a404f0915a 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyLegacySqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyLegacySqlAstTranslator.java @@ -210,7 +210,7 @@ public class DerbyLegacySqlAstTranslator extends Abstra if ( inListPredicate.isNegated() ) { appendSql( " not" ); } - appendSql( " in(" ); + appendSql( " in (" ); renderCommaSeparated( listExpressions ); appendSql( CLOSE_PARENTHESIS ); } diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdSqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdSqlAstTranslator.java index 63a0f0f9c2..4eaa45abe6 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdSqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdSqlAstTranslator.java @@ -238,7 +238,7 @@ public class FirebirdSqlAstTranslator extends AbstractS if ( inListPredicate.isNegated() ) { appendSql( " not" ); } - appendSql( " in(" ); + appendSql( " in (" ); renderCommaSeparated( listExpressions ); appendSql( CLOSE_PARENTHESIS ); } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java index 0c456545a4..3bd9f0e348 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java @@ -6770,7 +6770,7 @@ public abstract class AbstractSqlAstTranslator implemen if ( inListPredicate.isNegated() ) { appendSql( " not" ); } - appendSql( " in(" ); + appendSql( " in (" ); String separator = NO_SEPARATOR; for ( Expression expression : listExpressions ) { appendSql( separator ); @@ -6802,7 +6802,7 @@ public abstract class AbstractSqlAstTranslator implemen if ( inListPredicate.isNegated() ) { appendSql( " not" ); } - appendSql( " in(" ); + appendSql( " in (" ); String separator = NO_SEPARATOR; int bindValueCount = listExpressions.size(); @@ -6868,7 +6868,7 @@ public abstract class AbstractSqlAstTranslator implemen if ( inListPredicate.isNegated() ) { appendSql( " not" ); } - appendSql( " in(" ); + appendSql( " in (" ); separator = NO_SEPARATOR; itemNumber = 0; while ( iterator.hasNext() && itemNumber < inExprLimit ) { @@ -7421,7 +7421,7 @@ public abstract class AbstractSqlAstTranslator implemen if ( operator == ComparisonOperator.NOT_EQUAL ) { appendSql( " not" ); } - appendSql( " in(" ); + appendSql( " in (" ); renderExpressionsAsSubquery( rhsTuple.getExpressions() ); appendSql( CLOSE_PARENTHESIS ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndClassIdTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndClassIdTest.java index 05cf450721..79ed265b1e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndClassIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndClassIdTest.java @@ -100,8 +100,8 @@ public class BatchAndClassIdTest { Assertions.assertThat( statementInspector.getSqlQueries().get( 2 ) ).containsOnlyOnce( "?" ); } else { - Assertions.assertThat( statementInspector.getSqlQueries().get( 1 ) ).containsOnlyOnce( "in(?,?,?,?,?)" ); - Assertions.assertThat( statementInspector.getSqlQueries().get( 2 ) ).containsOnlyOnce( "in(?,?,?,?,?)" ); + Assertions.assertThat( statementInspector.getSqlQueries().get( 1 ) ).containsOnlyOnce( "in (?,?,?,?,?)" ); + Assertions.assertThat( statementInspector.getSqlQueries().get( 2 ) ).containsOnlyOnce( "in (?,?,?,?,?)" ); } statementInspector.clear(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdId2Test.java b/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdId2Test.java index ce638c9631..33b43c851e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdId2Test.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdId2Test.java @@ -100,8 +100,8 @@ public class BatchAndEmbeddedIdId2Test { Assertions.assertThat( statementInspector.getSqlQueries().get( 2 ) ).containsOnlyOnce( "?" ); } else { - Assertions.assertThat( statementInspector.getSqlQueries().get( 1 ) ).containsOnlyOnce( "in(?,?,?,?,?)" ); - Assertions.assertThat( statementInspector.getSqlQueries().get( 2 ) ).containsOnlyOnce( "in(?,?,?,?,?)" ); + Assertions.assertThat( statementInspector.getSqlQueries().get( 1 ) ).containsOnlyOnce( "in (?,?,?,?,?)" ); + Assertions.assertThat( statementInspector.getSqlQueries().get( 2 ) ).containsOnlyOnce( "in (?,?,?,?,?)" ); } statementInspector.clear(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdIdAndLazyCollectionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdIdAndLazyCollectionTest.java index 58fb999b28..a63f60a9ef 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdIdAndLazyCollectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdIdAndLazyCollectionTest.java @@ -108,8 +108,8 @@ public class BatchAndEmbeddedIdIdAndLazyCollectionTest { Assertions.assertThat( statementInspector.getSqlQueries().get( 1 ) ).containsOnlyOnce( "?" ); } else { - Assertions.assertThat( statementInspector.getSqlQueries().get( 0 ) ).containsOnlyOnce( "in(?,?,?,?,?)" ); - Assertions.assertThat( statementInspector.getSqlQueries().get( 1 ) ).containsOnlyOnce( "in(?,?,?,?,?)" ); + Assertions.assertThat( statementInspector.getSqlQueries().get( 0 ) ).containsOnlyOnce( "in (?,?,?,?,?)" ); + Assertions.assertThat( statementInspector.getSqlQueries().get( 1 ) ).containsOnlyOnce( "in (?,?,?,?,?)" ); } } ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdIdTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdIdTest.java index 6e1c2f46d1..036773d2e2 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchAndEmbeddedIdIdTest.java @@ -98,8 +98,8 @@ public class BatchAndEmbeddedIdIdTest { assertThat( statementInspector.getSqlQueries().get( 2 ) ).containsOnlyOnce( "?" ); } else { - assertThat( statementInspector.getSqlQueries().get( 1 ) ).containsOnlyOnce( "in(?,?,?,?,?)" ); - assertThat( statementInspector.getSqlQueries().get( 2 ) ).containsOnlyOnce( "in(?,?,?,?,?)" ); + assertThat( statementInspector.getSqlQueries().get( 1 ) ).containsOnlyOnce( "in (?,?,?,?,?)" ); + assertThat( statementInspector.getSqlQueries().get( 2 ) ).containsOnlyOnce( "in (?,?,?,?,?)" ); } statementInspector.clear(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/InClauseParameterPaddingCriteriaTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/InClauseParameterPaddingCriteriaTest.java index e5f0942705..f2330902b0 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/InClauseParameterPaddingCriteriaTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/InClauseParameterPaddingCriteriaTest.java @@ -75,7 +75,7 @@ public class InClauseParameterPaddingCriteriaTest { assertEquals( 1, ids.size() ); } ); - assertTrue( statementInspector.getSqlQueries().get( 0 ).endsWith( "in(?,?,?,?,?,?,?,?)" ) ); + assertTrue( statementInspector.getSqlQueries().get( 0 ).endsWith( "in (?,?,?,?,?,?,?,?)" ) ); } @Test @@ -102,7 +102,7 @@ public class InClauseParameterPaddingCriteriaTest { assertEquals( 1, ids.size() ); } ); - assertTrue( statementInspector.getSqlQueries().get( 0 ).endsWith( "in(d1_0.id,d1_0.id,d1_0.id)" ) ); + assertTrue( statementInspector.getSqlQueries().get( 0 ).endsWith( "in (d1_0.id,d1_0.id,d1_0.id)" ) ); } @Entity(name = "Document") diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/InClauseParameterPaddingTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/InClauseParameterPaddingTest.java index c4dcd2f505..8dbea28adc 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/InClauseParameterPaddingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/InClauseParameterPaddingTest.java @@ -54,16 +54,16 @@ public class InClauseParameterPaddingTest { @Test public void testInClauseParameterPadding(EntityManagerFactoryScope scope) { - validateInClauseParameterPadding( scope, "in(?)", 1 ); - validateInClauseParameterPadding( scope, "in(?,?)", 1, 2 ); - validateInClauseParameterPadding( scope, "in(?,?,?,?)", 1, 2, 3 ); - validateInClauseParameterPadding( scope, "in(?,?,?,?)", 1, 2, 3, 4 ); - validateInClauseParameterPadding( scope, "in(?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5 ); - validateInClauseParameterPadding( scope, "in(?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5, 6 ); - validateInClauseParameterPadding( scope, "in(?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5, 6, 7 ); - validateInClauseParameterPadding( scope, "in(?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5, 6, 7, 8 ); - validateInClauseParameterPadding( scope, "in(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5, 6, 7, 8, 9 ); - validateInClauseParameterPadding( scope, "in(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ); + validateInClauseParameterPadding( scope, "in (?)", 1 ); + validateInClauseParameterPadding( scope, "in (?,?)", 1, 2 ); + validateInClauseParameterPadding( scope, "in (?,?,?,?)", 1, 2, 3 ); + validateInClauseParameterPadding( scope, "in (?,?,?,?)", 1, 2, 3, 4 ); + validateInClauseParameterPadding( scope, "in (?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5 ); + validateInClauseParameterPadding( scope, "in (?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5, 6 ); + validateInClauseParameterPadding( scope, "in (?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5, 6, 7 ); + validateInClauseParameterPadding( scope, "in (?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5, 6, 7, 8 ); + validateInClauseParameterPadding( scope, "in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5, 6, 7, 8, 9 ); + validateInClauseParameterPadding( scope, "in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ); } private void validateInClauseParameterPadding( diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/MaxInExpressionParameterPaddingTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/MaxInExpressionParameterPaddingTest.java index a4579dc7a5..c260f861d3 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/MaxInExpressionParameterPaddingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/MaxInExpressionParameterPaddingTest.java @@ -83,7 +83,7 @@ public class MaxInExpressionParameterPaddingTest { ); StringBuilder expectedInClause = new StringBuilder(); - expectedInClause.append( "in(?" ); + expectedInClause.append( "in (?" ); for ( int i = 1; i < MAX_COUNT; i++ ) { expectedInClause.append( ",?" ); } @@ -109,7 +109,7 @@ public class MaxInExpressionParameterPaddingTest { ); StringBuilder expectedInClause = new StringBuilder(); - expectedInClause.append( "in(?" ); + expectedInClause.append( "in (?" ); for ( int i = 1; i < MAX_COUNT; i++ ) { expectedInClause.append( ",?" ); } @@ -134,12 +134,12 @@ public class MaxInExpressionParameterPaddingTest { ); StringBuilder expectedInClause = new StringBuilder(); - expectedInClause.append( "in(?" ); + expectedInClause.append( "in (?" ); for ( int i = 1; i < MAX_COUNT; i++ ) { expectedInClause.append( ",?" ); } expectedInClause.append( ")" ); - expectedInClause.append( " or p1_0.id in(?)" ); + expectedInClause.append( " or p1_0.id in (?)" ); assertTrue( statementInspector.getSqlQueries().get( 0 ).endsWith( expectedInClause.toString() ) ); } @@ -160,12 +160,12 @@ public class MaxInExpressionParameterPaddingTest { ); StringBuilder expectedInClause = new StringBuilder(); - expectedInClause.append( "in(?" ); + expectedInClause.append( "in (?" ); for ( int i = 1; i < MAX_COUNT; i++ ) { expectedInClause.append( ",?" ); } expectedInClause.append( ")" ); - expectedInClause.append( " or p1_0.id in(?,?,?,?)" ); + expectedInClause.append( " or p1_0.id in (?,?,?,?)" ); assertTrue( statementInspector.getSqlQueries().get( 0 ).endsWith( expectedInClause.toString() ) ); } @@ -186,17 +186,17 @@ public class MaxInExpressionParameterPaddingTest { ); StringBuilder expectedInClause = new StringBuilder(); - expectedInClause.append( "in(?" ); + expectedInClause.append( "in (?" ); for ( int i = 1; i < MAX_COUNT; i++ ) { expectedInClause.append( ",?" ); } expectedInClause.append( ")" ); - expectedInClause.append( " or p1_0.id in(?"); + expectedInClause.append( " or p1_0.id in (?"); for ( int i = 1; i < MAX_COUNT; i++ ) { expectedInClause.append( ",?" ); } expectedInClause.append( ")" ); - expectedInClause.append( " or p1_0.id in(?,?,?,?)" ); + expectedInClause.append( " or p1_0.id in (?,?,?,?)" ); assertTrue( statementInspector.getSqlQueries().get( 0 ).endsWith( expectedInClause.toString() ) );