-->
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.  [ 2 posts ] 
Author Message
 Post subject: Unknown entiry error!!!
PostPosted: Tue Dec 19, 2006 10:09 am 
Newbie

Joined: Tue Dec 19, 2006 9:16 am
Posts: 6
I have code (hibername 3.2) with spring

public class AccessDBSql extends HibernateDaoSupport
{
public AccessDBSql()
{
}

public List selectListEducation()
{

String sql =
"select "+
"edu.EMPLID as {edu.EMPLID}, "+
"edu.EDUCATION_ID as {edu.EDUCATION_ID}, "+
"edu.BEGIN_YEAR as {edu.BEGIN_YEAR}, "+
"edu.END_YEAR as {edu.END_YEAR}, "+
"edu.INSTITUTION as {edu.INSTITUTION}, "+
"edu.LOCATION as {edu.LOCATION}, "+
"edu.COUNTRY as {edu.COUNTRY}, "+
"edu.DEGREE as {edu.DEGREE}, "+
"edu.STUDY_FIELD as {edu.STUDY_FIELD}, "+
"edu.CHANGEUSER as {edu.CHANGEUSER}, "+
"edu.CHANGEDT as {edu.CHANGEDT} "+
" from education edu "+
" order by 2";

SessionFactory sf = getHibernateTemplate().getSessionFactory();
Session session = sf.getCurrentSession();
//Session session = getHibernateTemplate().getSession();
List list = session.createSQLQuery(sql)
.addEntity("edu", Education.class).list();
return list;
}
}

and I got the following errors:


[java] org.hibernate.MappingException: Unknown entity: domain.Education

There is not compile error. This is runtime error

-Henry


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 11:21 am 
Beginner
Beginner

Joined: Thu Oct 12, 2006 6:19 pm
Posts: 34
Location: Guatemala
Hi zhlu, can you provide your mapping resource (Education.hbm.xml)?, please

_________________
God is Love


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.