HHH-8413 - Rename ProcedureResults -> ProcedureOutputs
This commit is contained in:
parent
e42e786e8d
commit
cd812b6d65
|
@ -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
|
* Retrieves access to outputs of this procedure call. Can be called multiple times, returning the same
|
||||||
* ProcedureResult instance each time.
|
* ProcedureOutputs instance each time.
|
||||||
* <p/>
|
* <p/>
|
||||||
* 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.
|
* 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
|
* Extract the disconnected representation of this call. Used in HEM to allow redefining a named query
|
||||||
|
|
|
@ -370,7 +370,7 @@ public class ProcedureCallImpl extends AbstractBasicQueryContractImpl implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProcedureOutputs getResult() {
|
public ProcedureOutputs getOutputs() {
|
||||||
if ( outputs == null ) {
|
if ( outputs == null ) {
|
||||||
outputs = buildOutputs();
|
outputs = buildOutputs();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ import javax.persistence.TemporalType;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.hibernate.HibernateException;
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.cfg.AvailableSettings;
|
import org.hibernate.cfg.AvailableSettings;
|
||||||
|
@ -142,7 +141,7 @@ public class StoredProcedureResultSetMappingTest extends BaseUnitTestCase {
|
||||||
session.beginTransaction();
|
session.beginTransaction();
|
||||||
|
|
||||||
ProcedureCall call = session.createStoredProcedureCall( "allEmployeeNames", "id-fname-lname" );
|
ProcedureCall call = session.createStoredProcedureCall( "allEmployeeNames", "id-fname-lname" );
|
||||||
ProcedureOutputs outputs = call.getResult();
|
ProcedureOutputs outputs = call.getOutputs();
|
||||||
ResultSetOutput output = ExtraAssertions.assertTyping( ResultSetOutput.class, outputs.getCurrent() );
|
ResultSetOutput output = ExtraAssertions.assertTyping( ResultSetOutput.class, outputs.getCurrent() );
|
||||||
assertEquals( 3, output.getResultList().size() );
|
assertEquals( 3, output.getResultList().size() );
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase {
|
||||||
session.beginTransaction();
|
session.beginTransaction();
|
||||||
|
|
||||||
ProcedureCall procedureCall = session.createStoredProcedureCall( "user");
|
ProcedureCall procedureCall = session.createStoredProcedureCall( "user");
|
||||||
ProcedureOutputs procedureOutputs = procedureCall.getResult();
|
ProcedureOutputs procedureOutputs = procedureCall.getOutputs();
|
||||||
Output currentOutput = procedureOutputs.getCurrent();
|
Output currentOutput = procedureOutputs.getCurrent();
|
||||||
assertNotNull( currentOutput );
|
assertNotNull( currentOutput );
|
||||||
ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput );
|
ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput );
|
||||||
|
@ -187,7 +187,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase {
|
||||||
session.beginTransaction();
|
session.beginTransaction();
|
||||||
|
|
||||||
ProcedureCall query = session.createStoredProcedureCall( "findOneUser" );
|
ProcedureCall query = session.createStoredProcedureCall( "findOneUser" );
|
||||||
ProcedureOutputs procedureResult = query.getResult();
|
ProcedureOutputs procedureResult = query.getOutputs();
|
||||||
Output currentOutput = procedureResult.getCurrent();
|
Output currentOutput = procedureResult.getCurrent();
|
||||||
assertNotNull( currentOutput );
|
assertNotNull( currentOutput );
|
||||||
ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput );
|
ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput );
|
||||||
|
@ -206,7 +206,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase {
|
||||||
session.beginTransaction();
|
session.beginTransaction();
|
||||||
|
|
||||||
ProcedureCall query = session.createStoredProcedureCall( "findUsers" );
|
ProcedureCall query = session.createStoredProcedureCall( "findUsers" );
|
||||||
ProcedureOutputs procedureResult = query.getResult();
|
ProcedureOutputs procedureResult = query.getOutputs();
|
||||||
Output currentOutput = procedureResult.getCurrent();
|
Output currentOutput = procedureResult.getCurrent();
|
||||||
assertNotNull( currentOutput );
|
assertNotNull( currentOutput );
|
||||||
ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput );
|
ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput );
|
||||||
|
@ -243,7 +243,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase {
|
||||||
ProcedureCall query = session.createStoredProcedureCall( "findUserRange" );
|
ProcedureCall query = session.createStoredProcedureCall( "findUserRange" );
|
||||||
query.registerParameter( "start", Integer.class, ParameterMode.IN ).bindValue( 1 );
|
query.registerParameter( "start", Integer.class, ParameterMode.IN ).bindValue( 1 );
|
||||||
query.registerParameter( "end", Integer.class, ParameterMode.IN ).bindValue( 2 );
|
query.registerParameter( "end", Integer.class, ParameterMode.IN ).bindValue( 2 );
|
||||||
ProcedureOutputs procedureResult = query.getResult();
|
ProcedureOutputs procedureResult = query.getOutputs();
|
||||||
Output currentOutput = procedureResult.getCurrent();
|
Output currentOutput = procedureResult.getCurrent();
|
||||||
assertNotNull( currentOutput );
|
assertNotNull( currentOutput );
|
||||||
ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput );
|
ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, currentOutput );
|
||||||
|
@ -268,7 +268,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase {
|
||||||
ProcedureCall query = session.createStoredProcedureCall( "findUserRange" );
|
ProcedureCall query = session.createStoredProcedureCall( "findUserRange" );
|
||||||
query.registerParameter( 1, Integer.class, ParameterMode.IN ).bindValue( 1 );
|
query.registerParameter( 1, Integer.class, ParameterMode.IN ).bindValue( 1 );
|
||||||
query.registerParameter( 2, Integer.class, ParameterMode.IN ).bindValue( 2 );
|
query.registerParameter( 2, Integer.class, ParameterMode.IN ).bindValue( 2 );
|
||||||
ProcedureOutputs procedureResult = query.getResult();
|
ProcedureOutputs procedureResult = query.getOutputs();
|
||||||
Output currentOutput = procedureResult.getCurrent();
|
Output currentOutput = procedureResult.getCurrent();
|
||||||
assertNotNull( currentOutput );
|
assertNotNull( currentOutput );
|
||||||
ResultSetOutput resultSetReturn = assertTyping( ResultSetOutput.class, 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( 1, Integer.class, ParameterMode.IN );
|
||||||
query.registerParameter( 2, Integer.class, ParameterMode.IN ).bindValue( 2 );
|
query.registerParameter( 2, Integer.class, ParameterMode.IN ).bindValue( 2 );
|
||||||
try {
|
try {
|
||||||
query.getResult();
|
query.getOutputs();
|
||||||
fail( "Expecting failure due to missing parameter bind" );
|
fail( "Expecting failure due to missing parameter bind" );
|
||||||
}
|
}
|
||||||
catch (JDBCException expected) {
|
catch (JDBCException expected) {
|
||||||
|
@ -310,7 +310,7 @@ public class StoredProcedureTest extends BaseCoreFunctionalTestCase {
|
||||||
query.registerParameter( "start", Integer.class, ParameterMode.IN );
|
query.registerParameter( "start", Integer.class, ParameterMode.IN );
|
||||||
query.registerParameter( "end", Integer.class, ParameterMode.IN ).bindValue( 2 );
|
query.registerParameter( "end", Integer.class, ParameterMode.IN ).bindValue( 2 );
|
||||||
try {
|
try {
|
||||||
query.getResult();
|
query.getOutputs();
|
||||||
fail( "Expecting failure due to missing parameter bind" );
|
fail( "Expecting failure due to missing parameter bind" );
|
||||||
}
|
}
|
||||||
catch (JDBCException expected) {
|
catch (JDBCException expected) {
|
||||||
|
|
|
@ -248,7 +248,7 @@ public class StoredProcedureQueryImpl extends BaseQueryImpl implements StoredPro
|
||||||
|
|
||||||
protected ProcedureOutputs outputs() {
|
protected ProcedureOutputs outputs() {
|
||||||
if ( procedureResult == null ) {
|
if ( procedureResult == null ) {
|
||||||
procedureResult = procedureCall.getResult();
|
procedureResult = procedureCall.getOutputs();
|
||||||
}
|
}
|
||||||
return procedureResult;
|
return procedureResult;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue