Skip to content

Commit 98fab35

Browse files
Felixyrodiere
authored andcommitted
HHH-16648 Fixed multiline string
1 parent e5afffc commit 98fab35

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/hql/customFunctions/CountItemsGreaterValSqmFunction.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
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>.
6+
*/
17
package org.hibernate.orm.test.hql.customFunctions;
28

39
import org.hibernate.dialect.Dialect;

hibernate-core/src/test/java/org/hibernate/orm/test/hql/customFunctions/CustomDialectFunctionTest.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
/*
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>.
6+
*/
17
package org.hibernate.orm.test.hql.customFunctions;
28

39
import jakarta.persistence.EntityManager;
410
import org.hibernate.Session;
511
import org.hibernate.cfg.AvailableSettings;
612
import org.hibernate.cfg.Configuration;
7-
import org.hibernate.cfg.Environment;
813
import org.hibernate.dialect.PostgreSQLDialect;
914
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
1015
import org.hibernate.testing.orm.junit.RequiresDialect;
@@ -44,11 +49,10 @@ public void test_custom_sqm_functions() {
4449

4550
entityManager.unwrap(Session.class).doWork(connection -> {
4651
try (Statement statement = connection.createStatement()) {
47-
statement.executeUpdate("""
48-
create or replace function greater_than(c bigint, val numeric, gr_val numeric) returns bigint as $$ begin return case when val > gr_val then (c + 1)::bigint else c::bigint end; end; $$ language "plpgsql";
49-
create or replace function agg_final(c bigint) returns bigint as $$ begin return c; end; $$ language "plpgsql";
50-
create or replace aggregate count_items_greater_val(numeric, numeric) (sfunc = greater_than, stype = bigint, finalfunc = agg_final, initcond = 0);
51-
"""
52+
statement.executeUpdate(
53+
"create or replace function greater_than(c bigint, val numeric, gr_val numeric) returns bigint as $$ begin return case when val > gr_val then (c + 1)::bigint else c::bigint end; end; $$ language 'plpgsql'; " +
54+
"create or replace function agg_final(c bigint) returns bigint as $$ begin return c; end; $$ language 'plpgsql'; " +
55+
"create or replace aggregate count_items_greater_val(numeric, numeric) (sfunc = greater_than, stype = bigint, finalfunc = agg_final, initcond = 0);"
5256
);
5357
}
5458
});

hibernate-core/src/test/java/org/hibernate/orm/test/hql/customFunctions/Employee.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
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>.
6+
*/
17
package org.hibernate.orm.test.hql.customFunctions;
28

39
import jakarta.persistence.Entity;

hibernate-core/src/test/java/org/hibernate/orm/test/hql/customFunctions/ExtendedPGDialect.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package org.hibernate.orm.test.hql.customFunctions;
2-
2+
/*
3+
* Hibernate, Relational Persistence for Idiomatic Java
4+
*
5+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
6+
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
7+
*/
38
import org.hibernate.boot.model.FunctionContributions;
49
import org.hibernate.dialect.DatabaseVersion;
510
import org.hibernate.dialect.PostgreSQLDialect;

0 commit comments

Comments
 (0)