-->
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: Named query using internal function
PostPosted: Mon Jan 16, 2006 2:48 pm 
Newbie

Joined: Mon Jan 16, 2006 2:38 pm
Posts: 4
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!


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.