Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Spring ORM HibernateTemplate Mapping Exception  RSS feed

Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using msSqlServer Database. StoredProcedure takes two parameters, and returns one parameter.

Spring HibernateTemplate Code

Here is my Java code:

List l=ht.findByNamedQuery("MY_REF_STORED_PROC1");

Mapping file:

mapping file:
<sql-query name="MY_REF_STORED_PROC1" callable="true">
<return alias="usr" class="SomePOJO">
<return-property name="dSId" column="DSET_ID" />
exec MY_STORED_PROC1 ( :dSId,:createdUserId )

I am getting the bellow Exception:

org.hibernate.QueryException: Not all named parameters have been set: [dSId, createdUserId] [exec MY_STORED_PROC1 ( :dSId,:createdUserId )]

Please give me a solution for this issue.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!