Spring Boot and JPA: unable to pass Custom object to stored procedure

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Spring Boot and JPA: unable to pass Custom object to stored procedure

Amol Dhagdi
This is type 

create OR REPLACE type Temp as object
(
rollNo NUMBER     
,Name VARCHAR2 (50)   
,age NUMBER 
);

This is Procedure 

CREATE OR REPLACE procedure InsertStud (
record IN Temp 
) as
begin
INSERT INTO Stud Values(record);
End;


This is JPA code 

StoredProcedureQuery query = em.createStoredProcedureQuery("InsertSalesOrder");
query.registerStoredProcedureParameter("orderd", Object.class, ParameterMode.IN);
query.setParameter("orderd", studentObj);
query.execute();


Error
org.hibernate.exception.SQLGrammarException: Error calling CallableStatement.getMoreResults



Could you please help me

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Spring Boot and JPA: unable to pass Custom object to stored procedure

François Schiettecatte
What does this have to do with myBatis? This looks like a Hibernate issue…

François

On Mar 27, 2018, at 6:37 AM, Amol Dhagdi <[hidden email]> wrote:

This is type 

create OR REPLACE type Temp as object
(
rollNo NUMBER     
,Name VARCHAR2 (50)   
,age NUMBER 
);

This is Procedure 

CREATE OR REPLACE procedure InsertStud (
record IN Temp 
) as
begin
INSERT INTO Stud Values(record);
End;


This is JPA code 

StoredProcedureQuery query = em.createStoredProcedureQuery("InsertSalesOrder");
query.registerStoredProcedureParameter("orderd", Object.class, ParameterMode.IN);
query.setParameter("orderd", studentObj);
query.execute();


Error
org.hibernate.exception.SQLGrammarException: Error calling CallableStatement.getMoreResults



Could you please help me


--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.