I am using Hibernates getNamedQuery() API to call a stored proc and I need to pass an array to Oracle stored proc.
How can I set that array type parameter using setParameter().
procedure get_all_users_report( PO_RESULT OUT gt_cursor
)
as
v_insert varchar(4000);
begin
INSERT INTO tmp_usersreport(userinfo_id , username, isactive)
(
SELECT userinfo_id , username, isactive
FROM userinfo
WHERE isactive = 1
);
open PO_RESULT for
select username from tmp_usersreport;
end get_all_users_report;tmp_usersreport
tmp_usersreport is a global temp table defined in ORACLE DB.
Iterator it = users.iterator();
while(it.hasNext())
{
UserReport menu = (UserReport) it.next();
}
HibernateUtil.closeSession();
Exception is:
Initial SessionFactory creation failed.org.hibernate.MappingException: Could not read mappings from resource: sp.hbm.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at HibernateUtil.<clinit>(HibernateUtil.java:17)
at test4.test(test4.java:55)
at test4.main(test4.java:17)
Caused by: org.hibernate.MappingException: Could not read mappings from resource: sp.hbm.xml
tmp_usersreport is a global temp table defined in ORACLE DB.
My Hibernate mapping is called sp.hbm.xml:
My return DTO is:
Java Code to call stored proc:
Exception is:
Initial SessionFactory creation failed.org.hibernate.MappingException: Could not read mappings from resource: sp.hbm.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at HibernateUtil.<clinit>(HibernateUtil.java:17)
at test4.test(test4.java:55)
at test4.main(test4.java:17)
Caused by: org.hibernate.MappingException: Could not read mappings from resource: sp.hbm.xml