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

Description

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(kyeganid) }
</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;

Environment

None

Activity

Show:
Max Rydahl Andersen
June 17, 2008, 6:14 AM

No, it is expected behavior to not allow partial entity objects to be returned.

Use a ResultTransformer if you want partially filled objects.

Steve Ebersole
March 22, 2011, 6:06 AM

Bulk closing stale resolved issues

Rejected

Assignee

Unassigned

Reporter

mahdi asgari

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major