Error Non-mapped
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
Mapping Error No Devices Discovered
workings and policies of this site About Us Learn more about Stack error mapping failed Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs bwengine-100041 mapping error Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them;
Table Name Is Not Mapped Hibernate
it only takes a minute: Sign up Hibernate table not mapped error up vote 22 down vote favorite 6 I have a web application that use Hibernate to make CRUD operations over a database. I got an error saying that the table is not mapped. See the Java files: Error message: org.springframework.orm.hibernate3.HibernateQueryException: Books is not mapped [SELECT COUNT(*) FROM
Hibernate Class Is Not Mapped
Books]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Books is not mapped [SELECT COUNT(*) FROM Books] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:660) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) ... Caused by: org.hibernate.hql.ast.QuerySyntaxException: Books is not mapped [SELECT COUNT(*) FROM Books] at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:181) at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:111) at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:93) ... Here's my DAO.java method: public int getTotalBooks(){ return DataAccessUtils.intResult(hibernateTemplate.find("SELECT COUNT(*) FROM Books")); } Book.java: @Entity @Table(name="Books") public class Book { @Id @GeneratedValue @Column(name="id") private int id; @Column(name="title", nullable=false) private String title; ... } How should I modify it in order to work? java eclipse spring hibernate hibernate-mapping share|improve this question edited Jul 20 at 15:37 Gray 77.8k12164227 asked Jan 21 '13 at 19:44 Pascut 7261724 What a package name where persistence classes? –Roman C Jan 21 '13 at 20:23 please reformulate, I don't understand your idea –Pascut Jan 21 '13 at 20:30 See the answer. –Roman C Jan 21 '13 at 20:31 add a comment| 4 Answers 4 active oldest votes up vote 47 down vote accepted What does the exception message say? It says: Books is not mapped [SELECT COUNT(*) FROM Book
here for a quick overview of the site Help Center entity is not mapped jpa Detailed answers to any questions you might have Meta Discuss
Org.hibernate.hql.internal.ast.querysyntaxexception: Employee Is Not Mapped
the workings and policies of this site About Us Learn more about Stack Overflow no persistent classes found for query class the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x http://stackoverflow.com/questions/14446048/hibernate-table-not-mapped-error Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Hibernate error - QuerySyntaxException: users is not mapped [from users] up vote 56 down vote favorite 12 I'm http://stackoverflow.com/questions/9954590/hibernate-error-querysyntaxexception-users-is-not-mapped-from-users trying to get a list of all the users from "users" table and I get the following error: org.hibernate.hql.internal.ast.QuerySyntaxException: users is not mapped [from users] org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:180) org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:110) org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:93) This is the code I wrote to add/get users: public List