Hi buddies, I am a beginner in hibernate field, now I am doing a project which uses hibernate to call procedures, now It works, but an issue is not fixed. I have a module called Opportunity which has more than sixty columns, so in opportunity.hbm.xml, <class> tag includs all the properties, but for some searching, we only need several columns, so I confige <sql-query> with reqired columns, but when executed, an error raised, only <sql-query> has all the columns, It works. can any body tell me if there is some ways to handle this? or it only allow strictly mapping for <class> and <sql-query> mapping?
maybe U are little confused, like me give a example, <hibernate-mapping> <class dynamic-update="true" table="TI_UI_OPPORTUNITY" name="com.cvs.ti.model.Opportunity"> <id name="rowNbrId" column="ROW_NBR_ID"/> <property name="opporInd" column="OPPOR_IND" /> <property name="storeNbr" column="STORE_NBR" /> </class> <sql-query name="getOpporDetails" callable="true"> <return alias="opporDetails" class="com.cvs.ti.model.Opportunity"> <return-property name="rowNbrId" column="ROW_NBR_ID"/> <return-property name="opporInd" column="OPPOR_IND" /> </return> {Call TI.p_store_user.SP_TI_STORE_GETOPPORDETAILS(?,?,?,?)} </sql-query> </hibernate-mapping> for above example, there are 3 columns properties in class tag, but only two columns in <sql-query> return property, is it possible?
|