-->
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.  [ 1 post ] 
Author Message
 Post subject: error in executing stored procedure in hibernate
PostPosted: Wed Dec 12, 2007 4:55 am 
Newbie

Joined: Wed Dec 12, 2007 4:48 am
Posts: 6
CREATE OR REPLACE procedure sampleproc(st_cursor OUT SYS_REFCURSOR, userid number)

AS



BEGIN

OPEN st_cursor FOR

SELECT entity_id,user_id FROM entity where user_id=userid;



END;

/



procedure created successfully.



In hbm file i have configured this.





<sql-query name="getentitydetails" callable="true">

<return class="com.EntityDetails" alias="emp">

<return-property name="entityId" column="ENTITY_ID"></return-property>

<return-property name="userID" column="USER_ID"></return-property>



</return>

{ call sampleproc1(?) }

</sql-query>

EntityDetails.java





package com;



import java.io.Serializable;



public class EntityDetails implements Serializable{



public int entityId;

public int userID;

/*public String name;

public String city;*/

/*public String getCity() {

return city;

}

public void setCity(String city) {

this.city = city;

}*/

public int getEntityId() {

return entityId;

}

public void setEntityId(int entityId) {

this.entityId = entityId;

}

/*public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}*/

public int getUserID() {

return userID;

}

public void setUserID(int userID) {

this.userID = userID;

}

}





when i use the following line in test client it is giving an error


SessionFactory sf1=HibernateSessionFactory.getSessionFactroy();



org.hibernate.HibernateException: Errors in named queries: com.CourseDetails.getentitydetails

at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:339)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)

at com.HibernateSessionFactory.getSessionFactroy(HibernateSessionFactory.java:29)

at com.SimpleTestClient.main(SimpleTestClient.java:123)


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

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.