Hibernate version: 3.2.4.sp1
Name and version of the database you are using: Oracle 10g
Hi,
I am facing problems with calling stored procedures.
The stored proc heading line:
create or replace PROCEDURE USERALERT( p_cur OUT sys_refcursor);
The Alert data model:
@NamedNativeQuery(name="testuserAlert", callable=true, query = "{?=call USERALERT(:param1)}", resultSetMapping="result")
@SqlResultSetMapping( name="result", entities=@EntityResult( entityClass=com.abc.model.Alert.class,
fields={ @FieldResult( name="alertId", column="alertId" ),
@FieldResult( name="userId", column="userId" ),
@FieldResult( name="time", column="time" )} ) )
public class Alert {
protected Long alertId;
protected Long userId;
protected Date time;
The query constructed to use the same:
Query query = entityManager.createNamedQuery("testuserAlert");
query.setParameter("param1", null);
return query.getResultList();
The exception that it throws is:
java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00222: no function with name 'USERALERT' exists in this scope
ORA-06550: line 1, column 7:
When i call functions, it works perfectly fine.
But when i want to call the stored proc, it says:
no functionwith name 'USERALERT' exists in this scope
Why is it only looking for functions even if i m calling a stored proc. Have i missed out anything very basic?
Any help will be truly appreciated
Thanks
|