[hibernate-issues] [Hibernate-JIRA] Created: (HB-1571) XML Mapping properties number of items have to match all SP's return-property items
    Lawrence Loh (JIRA) 
    noreply at atlassian.com
       
    Wed Nov 29 17:05:05 EST 2006
    
    
  
XML Mapping properties number of items have to match all SP's return-property items
-----------------------------------------------------------------------------------
         Key: HB-1571
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-1571
     Project: Hibernate2
        Type: Bug
 Environment: NHibernate 1.2beta2
    Reporter: Lawrence Loh
 Attachments: GenericLookup999.hbm.xml
NHibernate tracker's link is down. So I submit this through this. Hope this offended anybody.
Please review the attached document.
Here is the sample of the mapping file -
...
    <id name="ID" column="ID" unsaved-value="0" type="int">
      <generator class="native"/>
    </id>
    <property name="Name" column="Name" not-null="false"  type="System.String" />
     <property name="Code" column="Code" not-null="true"  type="System.String" />
    <property name="Description" column="Description" not-null="true" type="System.String" />
  </class>
  <sql-query name="usp_GetActivityTypes">
    <return class="BusinessObject.GenericLookup,BusinessObject">
      <return-property name="ID" column="ID"/>
      <return-property name="Code" column="Code"/>
      <return-property name="Description" column="Description"/>    
    </return>
    exec usp_GetActivityTypes ?
  </sql-query>
Note - property "Name" is not in return-property in the stored procedures. 
Here is the exception is being thrown -
NHibernate.ADOException: could not execute query[SQL: exec usp_GetActivityTypes  ?] ---> System.IndexOutOfRangeException: Name0_0_
   at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
   at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
   at NHibernate.Driver.NHybridDataReader.GetOrdinal(String name)
   at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String name)
   
**** Important***
I would expect that number of "return-property"  should not be relevent/dependent  on number of properties declared.. In this case it does. 
-- 
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