From cd812b6d65a7b14f3b8546f05609a3d01a7ab3d0 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Sun, 25 Aug 2013 21:08:49 -0500 Subject: [PATCH] HHH-8413 - Rename ProcedureResults -> ProcedureOutputs --- .../org/hibernate/procedure/ProcedureCall.java | 8 ++++---- .../procedure/internal/ProcedureCallImpl.java | 2 +- .../StoredProcedureResultSetMappingTest.java | 3 +-- .../test/sql/storedproc/StoredProcedureTest.java | 14 +++++++------- .../jpa/internal/StoredProcedureQueryImpl.java | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/ProcedureCall.java b/hibernate-core/src/main/java/org/hibernate/procedure/ProcedureCall.java index e4c9206cbb..2c122182ad 100644 --- a/hibernate-core/src/main/java/org/hibernate/procedure/ProcedureCall.java +++ b/hibernate-core/src/main/java/org/hibernate/procedure/ProcedureCall.java @@ -140,14 +140,14 @@ public interface ProcedureCall extends BasicQueryContract, SynchronizeableQuery /** * Retrieves access to outputs of this procedure call. Can be called multiple times, returning the same - * ProcedureResult instance each time. + * ProcedureOutputs instance each time. *

- * If the procedure call has not actually be executed yet, it will be executed and then the ProcedureResult + * If the procedure call has not actually be executed yet, it will be executed and then the ProcedureOutputs * will be returned. * - * @return The ProcedureResult representation + * @return The ProcedureOutputs representation */ - public ProcedureOutputs getResult(); + public ProcedureOutputs getOutputs(); /** * Extract the disconnected representation of this call. Used in HEM to allow redefining a named query diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java b/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java index b6639043c9..97eeb00914 100644 --- a/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java @@ -370,7 +370,7 @@ public class ProcedureCallImpl extends AbstractBasicQueryContractImpl implements } @Override - public ProcedureOutputs getResult() { + public ProcedureOutputs getOutputs() { if ( outputs == null ) { outputs = buildOutputs(); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/sql/storedproc/StoredProcedureResultSetMappingTest.java b/hibernate-core/src/test/java/org/hibernate/test/sql/storedproc/StoredProcedureResultSetMappingTest.java index a1235df6dc..501300e415 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/sql/storedproc/StoredProcedureResultSetMappingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/sql/storedproc/StoredProcedureResultSetMappingTest.java @@ -34,7 +34,6 @@ import javax.persistence.TemporalType; import java.util.Date; -import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.AvailableSettings; @@ -142,7 +141,7 @@ public class StoredProcedureResultSetMappingTest extends BaseUnitTestCase { session.beginTransaction(); ProcedureCall call = session.createStoredProcedureCall( "allEmployeeNames", "id-fname-lname" ); - ProcedureOutputs outputs = call.getResult(); + ProcedureOutputs outputs = call.getOutputs(); ResultSetOutput output = ExtraAssertions.assertTyping( ResultSetOutput.class, outputs.getCurrent() ); assertEquals( 3, output.getResultList().size() ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/sql/storedproc/StoredProcedureTest.java b/hibernate-core/src/test/java/org/hibernate/test/sql/storedproc/StoredProcedureTest.java index cc3032398a..01afc956e5 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/sql/storedproc/StoredProcedureTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/sql/storedproc/StoredProcedureTest.java @@ -170,7 +170,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase { session.beginTransaction(); ProcedureCall procedureCall = session.createStoredProcedureCall( "user"); - ProcedureOutputs procedureOutputs = procedureCall.getResult(); + ProcedureOutputs procedureOutputs = procedureCall.getOutputs(); Output currentOutput = procedureOutputs.getCurrent(); assertNotNull( currentOutput ); ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput ); @@ -187,7 +187,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase { session.beginTransaction(); ProcedureCall query = session.createStoredProcedureCall( "findOneUser" ); - ProcedureOutputs procedureResult = query.getResult(); + ProcedureOutputs procedureResult = query.getOutputs(); Output currentOutput = procedureResult.getCurrent(); assertNotNull( currentOutput ); ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput ); @@ -206,7 +206,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase { session.beginTransaction(); ProcedureCall query = session.createStoredProcedureCall( "findUsers" ); - ProcedureOutputs procedureResult = query.getResult(); + ProcedureOutputs procedureResult = query.getOutputs(); Output currentOutput = procedureResult.getCurrent(); assertNotNull( currentOutput ); ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput ); @@ -243,7 +243,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase { ProcedureCall query = session.createStoredProcedureCall( "findUserRange" ); query.registerParameter( "start", Integer.class, ParameterMode.IN ).bindValue( 1 ); query.registerParameter( "end", Integer.class, ParameterMode.IN ).bindValue( 2 ); - ProcedureOutputs procedureResult = query.getResult(); + ProcedureOutputs procedureResult = query.getOutputs(); Output currentOutput = procedureResult.getCurrent(); assertNotNull( currentOutput ); ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput ); @@ -268,7 +268,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase { ProcedureCall query = session.createStoredProcedureCall( "findUserRange" ); query.registerParameter( 1, Integer.class, ParameterMode.IN ).bindValue( 1 ); query.registerParameter( 2, Integer.class, ParameterMode.IN ).bindValue( 2 ); - ProcedureOutputs procedureResult = query.getResult(); + ProcedureOutputs procedureResult = query.getOutputs(); Output currentOutput = procedureResult.getCurrent(); assertNotNull( currentOutput ); ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput ); @@ -298,7 +298,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase { query.registerParameter( 1, Integer.class, ParameterMode.IN ); query.registerParameter( 2, Integer.class, ParameterMode.IN ).bindValue( 2 ); try { - query.getResult(); + query.getOutputs(); fail( "Expecting failure due to missing parameter bind" ); } catch (JDBCException expected) { @@ -310,7 +310,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase { query.registerParameter( "start", Integer.class, ParameterMode.IN ); query.registerParameter( "end", Integer.class, ParameterMode.IN ).bindValue( 2 ); try { - query.getResult(); + query.getOutputs(); fail( "Expecting failure due to missing parameter bind" ); } catch (JDBCException expected) { diff --git a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/internal/StoredProcedureQueryImpl.java b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/internal/StoredProcedureQueryImpl.java index d00a4096d8..75e16d9189 100644 --- a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/internal/StoredProcedureQueryImpl.java +++ b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/internal/StoredProcedureQueryImpl.java @@ -248,7 +248,7 @@ public class StoredProcedureQueryImpl extends BaseQueryImpl implements StoredPro protected ProcedureOutputs outputs() { if ( procedureResult == null ) { - procedureResult = procedureCall.getResult(); + procedureResult = procedureCall.getOutputs(); } return procedureResult; }