Here is the solution just in case, I had problem because of wrong hibernate3.jar file
Code:
{call ? := random }
or
{? = call random}
are same and have no impact, Oracle included.
also with functions and procedures if you don't pass any data, you don't need () or alternatively you can put it
there is no equivalent of registerOutParameter
mapping xml file
Code:
<sql-query name="select">
<return-scalar column="num" type="long"/>
<return-scalar column="val" type="string"/>
{? = call random()}
</sql-query>
in java
Code:
Session session = ...
Query query = session.getNamedQuery("select");
//will execute and return the resultsets as List
List list = query.list();
Object items[] = (Object[]) list;
System.out.println (items[0] + " " + items[1]);