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