Exception in thread "main" org.springframework.orm.hibernate3.HibernateQueryException:
Test is not mapped [from Test t where t.name = ?];
nested exception is org.hibernate.hql.ast.QuerySyntaxException:
Test is not mapped [from Test t where t.name = ?] at
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:640)
Check the imports of your '@Entity' annotations in your beans
If it is:
org.hibernate.annotations.Entity;Then change it to:
import javax.persistence.Entity;and life will be sweet.
11 comments:
thank you, man!
... thank you ! *EXACTLY* what I was looking for ... dammn glad your post came in the first hits in my googling...
thanks :)
Thanks for gr8 help indeed.
Thanks :)
excellent, my problems is IMPORT
Hi, this didn't work for me, exactly the same error with import javax.persistence.Entity;
@Juan Manuel Formoso: I had the same error with import javax.persistence.Entity too, it turned out to be the lack of @Table annotation in my entity. Like this:
@Entity
@Table(name="table_name") // without this annotation it throws QuerySyntaxException: Table is not mapped
public class Table {
// class body
}
sigh of relief... small thing but hard to catch. :)
I came here seeking solution for
XYZ is not mapped[FROM XYZ ] hibernate exception.
I got it resolved by using full java class path instead of table name.I though it might be helpful somebody else also.Please look below for full description.
http://fundapass.blogspot.in/2012/09/xyz-is-not-mapped-from-xyz.html
Thanks !!!!
Post a Comment