-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Stored Procedure mapping causes error, callable not declared
PostPosted: Wed Apr 25, 2007 5:14 pm 
Newbie

Joined: Mon Apr 16, 2007 3:20 pm
Posts: 7
I have a stored procedure I am trying to map from sql server to Nhibernate. I have callable="true" and the error I am getting is:

The 'callable' attribute is not declared. An error occurred at , (12, 13).

It's when I assign my assembly to the Configuration object in this line:
Code:
Configuration cfg = new Configuration();
cfg.AddAssembly("EmployeeTimeTracker");


I am using NHibernate version 1.2, SQL Server 2005, .net 1.1 fmrwk.

It gets to my MngrEmps.hbm.xml file, and bombs. Here is the mapping:


Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
   <class name="EmployeeTimeTracker.MngrEmps, EmployeeTimeTracker" table="EMPLOYEE">
      <id name="EmpID" column="EMPLOYEEID" >
         <generator class="assigned" />
      </id>
      <property name="MngrID" column="EMPLOYEEPARENTID" />
      
      <loader query-ref="SP_GET_EMP_LIST" />
            
   </class>
   <sql-query name="SP_GET_EMP_LIST" callable="true">
      <return class="EmployeeTimeTracker.MngrEmps, EmployeeTimeTracker">
         <return-property name="MngrID" column="mgr_employee_id" />
         <return-property name="EmpID" column="employee_id" />         
      </return>
      exec SP_GET_EMP_LIST :empID
   </sql-query>      
</hibernate-mapping>


Please help. Thank you.


Top
 Profile  
 
 Post subject: Help w/ Stored proc
PostPosted: Wed Apr 25, 2007 8:40 pm 
Newbie

Joined: Mon Apr 16, 2007 3:20 pm
Posts: 7
I'm trying to just make this a call to a stored procedure, without the class. And i'm still getting the error about callable attribute not declared. Mapping is as follows? Help?

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">   
   <sql-query name="SP_GET_EMP_LIST" callable="true">
      <return alias="MngrEmps">
         <return-property name="MngrID" column="mgr_employee_id" />
         <return-property name="EmpID" column="employee_id" />         
      </return>
      exec SP_GET_EMP_LIST :empID
   </sql-query>      
</hibernate-mapping>


I've run this through xml spy to make sure the xml is well-formed. No issues there.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 26, 2007 1:19 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
NHibernate does not support callable attribute, all custom SQL is executed with CommandType.Text at this time.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.