-->
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: invalid column name
PostPosted: Mon Oct 09, 2006 6:28 am 
Newbie

Joined: Wed Oct 04, 2006 6:39 am
Posts: 2
Hi All,

I am using Hibernate 3.2 cr3 with oracle 9i & trying to call stored procedure which retrives data 2 columns(subset) of a 5 column table & return resultset. i getting the following exception
ERROR [org.hibernate.util.JDBCExceptionReporter] - <Invalid column name>
i am using getNamedQuery and used following configuration.
Please answer following questions?

1. Does hibernate support only return scalars and entities so that in stored procedure we need to specify select * or all column?
2. How can we use the projection on the stored procedure without using HQL?

Stored procedure

CREATE OR REPLACE PACKAGE BODY Pkg_Test2
IS
PROCEDURE get_my_list(p_record OUT ref_cur ,eventid IN NUMBER)
AS
BEGIN
OPEN p_record FOR
SELECT EVENT_ID, TITLE FROM EVENTS WHERE EVENT_ID=eventid;
END get_my_list;
END Pkg_Test2;
/


mapping file for procedure call

<sql-query name="test_select_sp" callable="true">
<return alias="evaa" class="events.Event">
<return-property name="id" column="EVENT_ID"/>
<return-property name="title" column="TITLE"/>
</return>
{ call pkg_test1.get_selected_list(?,:eventid)}
</sql-query>


Thanks,

Sagar


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.