-->
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: how to call oracle function with Hibernate JPA
PostPosted: Mon Mar 24, 2008 2:12 am 
Newbie

Joined: Thu Jun 14, 2007 1:59 am
Posts: 3
Is it possible to call oracle function other than procedure with Hibernate JPA? How?

I'm developing a web app with JBoss seam + Hibernate JPA, and I'd like to call an oracle function with JPA 's entityManager.createNativeQuery API。 But I failed.
The code has follows:
//===Java code with JPA
entityManager.createNativeQuery("{call get_filelist(?)}")
.setParameter(1, dirName)
.getSingleResult();

The oracle function is defined as follows:
//===Oracle function def

CREATE OR REPLACE FUNCTION get_filelist (p_path IN VARCHAR2)
RETURN VARCHAR2
AS
LANGUAGE JAVA
NAME 'FileList.RunThis(java.lang.String) return String';

The error code is as follows:

PLS-00221: 'GET_FILELIST' is not a procedure or is undefined .

In fact, I can see the get_filelist with sqlplus when typing 'desc get_filelist'.

Thanks for your suggestion.


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.