Hi, guys. New to the forum.
I have a problem using a named query, located in the class mapping file. Here's the mapping file:
Code:
<hibernate-mapping package="database.model">
<class name="Sec_user" table="sec_user">
<id name="userid" column="user_id">
<generator class="native" />
</id>
<property name="password" />
<property name="username" column="user_name" />
<property name="usergroup" column="usr_group" />
<property name="lastaccess" column="last_access" />
<property name="numbadattempts" column="num_bad_attempts" />
<property name="datauid" column="data_u_id" />
<property name="bsipassword" column="bsi_password" />
<property name="securityquestion" column="sec_question" />
<property name="securityanswer" column="sec_answer" />
<property name="sin" />
<property name="paperusercreatedate" column="pap_usr_creat_dt" />
<query name="unencrypted">
<![CDATA[select sec_out(datauid, 'NOTBSI23'), sec_out(sin , 'NOTBSI23')
from Sec_user]]>
</query>
</class>
</hibernate-mapping>
Notice the sec_out function. This is a user-written function. This is how I'm trying to use it:
Query q = session.getNamedQuery("unencrypted");
The session is being initialized elsewhere.
When I run this, I get a
Exception in thread "main" java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.MethodNode
I've been looking all over this forum for some way to do this. Spent my entire morning on it. Tried using a <sql-update> tag, and not even sure if that's right, since I can't find any sort of reference for it. Any suggestions on what to do?
For reference, the database is Oracle-driven. I can connect and grab data, but I need to to be able to run this function. Thanks in advance!