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)
|
|