-->
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: calling Sybase Database Procedure within Hibernate??????
PostPosted: Fri Jan 19, 2007 2:40 am 
Newbie

Joined: Fri Jan 19, 2007 2:23 am
Posts: 2
Hi all,

I am very new to Hibernate. Still trying to figure out basic stuff.
I am trying to call a proccedure in my database but getting an exception.
Here's the code of what I am doing.

Hibernate version: 3.2
Sybase Anywhere Server

Mapping documents: Desk.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="com.pongrass.gwt.ned.server.persistence.model" default-access="field">

<sql-query name="loadDesk" callable="true">
<return alias="u" class="Desk">
<return-property name="parentName" column="dbc_parent_name"/>
<return-property name="childName" column="dbc_child_name"/>
<return-property name="childPriority" column="dbc_child_priority"/>
<return-property name="childEdName" column="dbc_child_edname"/>
<return-property name="childID" column="dbc_child_id"/>
<return-property name="parentID" column="dbc_parent_id"/>
<return-property name="treeNodeID" column="dbc_tree_node_id"/>
</return>
{ call ED_GET_DESKS3() }
</sql-query>

</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
Query q = session.getNamedQuery("loadDesk");
List result = q.list();

Full stack trace of any exception that occurs:
[WARN] Error in named query: loadDesk
org.hibernate.MappingException: Unknown entity: com.pongrass.gwt.ned.server.persistence.model.Desk
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:548)
at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.getSQLLoadable(SQLQueryReturnProcessor.java:312)
at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.processRootReturn(SQLQueryReturnProcessor.java:353)
at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.processReturn(SQLQueryReturnProcessor.java:332)
at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.process(SQLQueryReturnProcessor.java:148)
at org.hibernate.loader.custom.sql.SQLCustomQuery.<init>(SQLCustomQuery.java:64)
at org.hibernate.engine.query.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:43)
at org.hibernate.engine.query.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:114)
at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:444)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:351)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)


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.