[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3347) Property Injection dos not work for unwanted properties and throw Invalid Coulumn Name Exception

mahdi asgari (JIRA) noreply at atlassian.com
Mon Jun 16 03:10:35 EDT 2008


Property Injection dos not work for unwanted properties and throw Invalid Coulumn Name Exception
------------------------------------------------------------------------------------------------

                 Key: HHH-3347
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3347
             Project: Hibernate3
          Issue Type: Bug
          Components: query-sql
    Affects Versions: 3.2.5
            Reporter: mahdi asgari


To speed up my query i dosn't return unwanted properties from my database function, but hibernate property binder try to set all properties.
I have got the following Exception when running named query "TblBisYeganChildsByYeganId"
I search in the forum and read the hibernate references but i cant find the correct solution,
would you please help me, is it a bug?
I am using Oracle10G,Hibernate 3.2.5.ga


The exception:
Hibernate: 
    { ? = call pkg_bis_yegan.func_sel_childsbyyeganid(?) }
[INFO ]  - could not read column value from result set: IS6_32_0_; Invalid column name
[WARN ]  - SQL Error: 17006, SQLState: null
[ERROR]  - Invalid column name


my Hibernate-Mapping xml

<hibernate-mapping>
    <class lazy="true" name="com.test.TblBisYegan" table="TBL_BIS_YEGAN" schema="AMAD">
        <id name="pkYeganId" type="java.lang.Long">
            <column name="PK_YEGAN_ID" precision="22" scale="0" />
            <generator class="assigned" />
        </id>
        <many-to-one name="tblBisInfoBaseDetail" class="com.test.TblBisInfoBaseDetail" fetch="join" lazy="false">
            <column name="FK_INFO_BASE_DETAIL_ID" precision="22" scale="0" />
        </many-to-one>
        <many-to-one name="tblBisYegan" class="com.test.TblBisYegan" fetch="join" lazy="false">
            <column name="FK_YEGAN_ID" precision="10" scale="0" />
        </many-to-one>
        <property name="unitNum" type="java.lang.Long">
            <column name="UNIT_NUM" precision="22" scale="0" />
        </property>
        <property name="yeganName" type="java.lang.String">
            <column name="YEGAN_NAME" length="100" not-null="true" />
        </property>
        <property name="isActive" type="java.lang.Long">
            <column name="IS_ACTIVE" precision="1" scale="0" />
        </property>
        <property name="isCreateAmval" type="java.lang.Long">
            <column name="IS_CREATE_AMVAL" precision="22" scale="0" />
        </property>
    </class>

    <sql-query name="TblBisYeganChildsByYeganId" callable="true">
	    <return  class="com.test.TblBisYegan">
	    	<return-property name="pkYeganId" column="PK_YEGAN_ID"/>
	    	<return-property name="yeganName" column="YEGAN_NAME"/>
	    	<return-property name="unitNum" column="UNIT_NUM"/>
	    	<return-property name="tblBisInfoBaseDetail">
	    		<return-column name="PK_INFO_BASE_DETAIL_ID"/>
	    	</return-property>
	    	<return-property name="tblBisYegan">
	    		<return-column name="PARENT_YEGAN_ID"/>
	    	</return-property>
	    </return>
		{ ? = call pkg_bis_yegan.func_sel_childsbyyeganid(:pkyeganid) }
    </sql-query>


</hibernate-mapping>

My Function is:

create or replace package body pkg_bis_yegan is
  function func_sel_childsbyyeganid(p_fk_yegan_id number)
    return sys_refcursor is
    func_result SYS_REFCURSOR;
  begin
    open func_result for
      select tbl_bis_yegan.pk_yegan_id,
             tbl_bis_yegan.yegan_name,
             tbl_bis_yegan.unit_num,
             null parent_yegan_id, -- if dos not exist hibernate throw exception
             null pk_info_base_detail_id -- if dos not exist hibernate throw exception
        from tbl_bis_yegan
       where tbl_bis_yegan.fk_yegan_id = p_fk_yegan_id
       order by tbl_bis_yegan.yegan_name;
    return func_result;
  end;
end pkg_bis_yegan;

-- 
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