-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Call Oracle Stored procedure wit NativeNamedQuery
PostPosted: Wed May 26, 2010 5:18 am 
Newbie

Joined: Wed May 26, 2010 5:02 am
Posts: 4
Hi,

I have a problem with NamedNativeQuery calling. I try to call an Oracle package procedure what has no return value and out parameter.
I wrote an Entity annotated class, what I added to my config, but when I try to use the query then I got an error:
"Named query not known. KarSet"

Here is the class definition:

Code:
package com.ath.db;
import java.io.Serializable;
import javax.persistence.Id;
import org.hibernate.annotations.Entity;
import org.hibernate.annotations.NamedNativeQuery;

@Entity
@NamedNativeQuery(name = "KarSet", query = "call flexutil.pkg_cl_util.set_kar_udf(?, ?)", callable = true, resultClass=AthKarSet.class)
public class AthKarSet implements Serializable
{
        private static final long serialVersionUID = 512975560291089577L;
       
        @Id
        public long getCallId()
        {
                return 1L;
        }
       
}


And the calling:

Code:
...
  Query lQuery = lSess.getNamedQuery("KarSet");
  lQuery.setParameter(0, lData.getAthLoanId());
  lQuery.setParameter(1, lData.getAthKarAct());
...


The package header:
Code:
  procedure set_kar_udf(p_hfe_id varchar2, p_value varchar2);


Do you have any idea, what is the problem?

Thank you!
Feri


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.