From c1d1695606c59b85d97e44477135cc2c526a17be Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Thu, 1 Aug 2013 01:19:33 -0500 Subject: [PATCH] HHH-8400 - Positional parameters defined on NamedStoredProcedureQuery not applied --- hibernate-core/hibernate-core.gradle | 4 +++- .../hibernate-entitymanager.gradle | 2 +- .../test/procedure/AbstractStoredProcedureTest.java | 4 ++-- .../hibernate/jpa/test/procedure/JpaTckUsageTest.java | 8 ++------ .../src/test/resources/hibernate.properties | 11 +++-------- 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index e536cf620e..d93524f588 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -29,11 +29,13 @@ dependencies { // for test runtime transitive = true } + // for testing stored procedure support + testCompile( libraries.derby ) + testRuntime( 'jaxen:jaxen:1.1' ) testRuntime( libraries.javassist ) testRuntime( libraries.unified_el ) - testRuntime( libraries.derby ) // for testing stored procedure support } def pomName() { diff --git a/hibernate-entitymanager/hibernate-entitymanager.gradle b/hibernate-entitymanager/hibernate-entitymanager.gradle index 7df4d61ca7..2043754a49 100644 --- a/hibernate-entitymanager/hibernate-entitymanager.gradle +++ b/hibernate-entitymanager/hibernate-entitymanager.gradle @@ -24,7 +24,7 @@ dependencies { // testRuntime( "org.glassfish.web:el-impl:2.1.2-b04" ) // for testing stored procedure support - testRuntime( libraries.derby ) + testCompile( libraries.derby ) } def pomName() { diff --git a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/procedure/AbstractStoredProcedureTest.java b/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/procedure/AbstractStoredProcedureTest.java index 27ea7a3969..eb36fdb470 100644 --- a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/procedure/AbstractStoredProcedureTest.java +++ b/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/procedure/AbstractStoredProcedureTest.java @@ -52,13 +52,13 @@ public abstract class AbstractStoredProcedureTest extends BaseEntityManagerFunct list = m2.getParameterDeclarations(); memento = list.get( 0 ); - assertEquals( Integer.valueOf( 0 ), memento.getPosition() ); + assertEquals( Integer.valueOf( 1 ), memento.getPosition() ); assertEquals( javax.persistence.ParameterMode.INOUT, memento.getMode() ); assertEquals( StringType.INSTANCE, memento.getHibernateType() ); assertEquals( String.class, memento.getType() ); memento = list.get( 1 ); - assertEquals( Integer.valueOf( 1 ), memento.getPosition() ); + assertEquals( Integer.valueOf( 2 ), memento.getPosition() ); assertEquals( javax.persistence.ParameterMode.INOUT, memento.getMode() ); assertEquals( LongType.INSTANCE, memento.getHibernateType() ); assertEquals( Long.class, memento.getType() ); diff --git a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/procedure/JpaTckUsageTest.java b/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/procedure/JpaTckUsageTest.java index a350a2e6e5..a834be7717 100644 --- a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/procedure/JpaTckUsageTest.java +++ b/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/procedure/JpaTckUsageTest.java @@ -24,7 +24,6 @@ package org.hibernate.jpa.test.procedure; import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; import javax.persistence.StoredProcedureQuery; import java.sql.Connection; import java.sql.DriverManager; @@ -32,14 +31,11 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import java.sql.Types; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.h2.tools.SimpleResultSet; - import org.hibernate.dialect.DerbyTenSevenDialect; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.jpa.AvailableSettings; @@ -51,7 +47,6 @@ import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.hibernate.testing.FailureExpected; @@ -223,7 +218,8 @@ public class JpaTckUsageTest extends BaseUnitTestCase { settings.put( org.hibernate.cfg.AvailableSettings.DIALECT, DerbyTenSevenDialect.class ); settings.put( org.hibernate.cfg.AvailableSettings.DRIVER, org.apache.derby.jdbc.EmbeddedDriver.class.getName() ); - settings.put( org.hibernate.cfg.AvailableSettings.URL, "jdbc:derby:hibernate-orm-testing;create=true" ); +// settings.put( org.hibernate.cfg.AvailableSettings.URL, "jdbc:derby:/tmp/hibernate-orm-testing;create=true" ); + settings.put( org.hibernate.cfg.AvailableSettings.URL, "jdbc:derby:memory:hibernate-orm-testing;create=true" ); settings.put( org.hibernate.cfg.AvailableSettings.USER, "" ); settings.put( org.hibernate.cfg.AvailableSettings.HBM2DDL_AUTO, "create-drop" ); diff --git a/hibernate-entitymanager/src/test/resources/hibernate.properties b/hibernate-entitymanager/src/test/resources/hibernate.properties index 13f415b5f0..ada04a6588 100644 --- a/hibernate-entitymanager/src/test/resources/hibernate.properties +++ b/hibernate-entitymanager/src/test/resources/hibernate.properties @@ -22,14 +22,9 @@ # Boston, MA 02110-1301 USA # -#hibernate.dialect org.hibernate.dialect.H2Dialect -#hibernate.connection.driver_class org.h2.Driver -#hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE;LOCK_TIMEOUT=10000 -#hibernate.connection.username sa - -hibernate.dialect org.hibernate.dialect.DerbyTenSevenDialect -hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver -hibernate.connection.url jdbc:derby:memory:hibernate-orm-testing;create=true +hibernate.dialect org.hibernate.dialect.H2Dialect +hibernate.connection.driver_class org.h2.Driver +hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE;LOCK_TIMEOUT=10000 hibernate.connection.username sa hibernate.connection.pool_size 5