[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2129) Invalid column name SQL Error: 17006, SQLState: null

sagar patkar (JIRA) noreply at atlassian.com
Thu Oct 5 03:23:24 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2129?page=comments#action_24725 ] 

sagar patkar commented on HHH-2129:
-----------------------------------

Since stored procedures currently only return scalars and entities, is it so that we should always retrieve all columns of table using select * or the column names which are mapped to particular fields of java class? Can we retrieve single column in result set as result from procedure? Does Hibernate 3.2 version support this feature? Please answer these questions in details since I didn't find any help from http://forum.hibernate.org/

> Invalid column name SQL Error: 17006, SQLState: null
> ----------------------------------------------------
>
>          Key: HHH-2129
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2129
>      Project: Hibernate3
>         Type: Bug

>   Components: query-sql
>     Versions: 3.2.0.cr3
>  Environment: Hibernate 3.2 cr3 with oracle 9i
>     Reporter: sagar patkar

>
>
> Hi,
> Is it required that stored procedure must return all the column in the resultset of the mapped class. i was trying to fetch only subset of column & i got the following exception
> ERROR [org.hibernate.util.JDBCExceptionReporter] - <Invalid column name>
> is it a bug? or is there any alternative solution for this?
> 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>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list