用hibernateTemplate().find()方法时出现以下错误
org.springframework.orm.hibernate3.HibernateQueryException: Manager is not mapped [from Manager]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Manager is not mapped [from Manager]
纠结了好长时间,上网一查才知道好多人出现过相同问题,原因一般有:
1,hbm.xml 没在beans.xml中配置
可我有啊
<property name="packagesToScan">
<list><value>com.fzb.shop.entity</value></list>
</property>
2,find()方法中的类名未写全
我原来是
this.getHibernateTemplate().find("from Manager");
应该为
this.getHibernateTemplate().find("from com.fzb.shop.entity.Manager");
但还是有些纠结,以后难道每个类名都得写全吗?有其他办法吗?
分享到:
相关推荐
在开发基于Spring与Hibernate整合的应用时,可能会遇到“`org.springframework.orm.hibernate3.LocalSessionFactoryBean` not found”这样的错误提示。这个问题通常发生在尝试通过Spring管理Hibernate ...
org.springframework.orm-3.0.4.RELEASE.jar org.springframework.oxm-3.0.4.RELEASE.jar org.springframework.spring-library-3.0.4.RELEASE.libd org.springframework.test-3.0.4.RELEASE.jar org.spring...
标题中的"org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException"是一个具体的异常类型,源自Spring框架的Hibernate4模块。这个异常通常在乐观锁(Optimistic Locking)机制失败时抛出,...
org.springframework.orm-3.0.0.M1.jar
org.springframework.orm-3.0.5.RELEASE.jar org.springframework.oxm-3.0.5.RELEASE.jar org.springframework.test-3.0.5.RELEASE.jar org.springframework.transaction-3.0.5.RELEASE.jar org.springframework.web...
org.springframework.orm-3.1.RELEASE.jar org.springframework.oxm-3.1.RELEASE.jar org.springframework.spring-library-3.1.RELEASE.libd org.springframework.test-3.1.RELEASE.jar org.springframework....
其中,`org.springframework.orm.jar`是Spring框架中的一个子模块,主要关注对象关系映射(ORM)集成,使得Java应用程序能够方便地与各种数据库进行交互。本文将深入探讨Spring ORM模块的核心概念、功能以及实际应用...
org.springframework.orm-3.1.0.M2
当执行查询操作时,如果根据指定的ID没有找到对应的实体对象,Hibernate会抛出 `org.springframework.orm.ObjectRetrievalFailureException` 异常。例如,在以下场景中: ``` org.springframework.orm....
org.springframework.orm-3.1.1.RELEASE org.springframework.oxm-3.1.1.RELEASE org.springframework.test-3.1.1.RELEASE org.springframework.transaction-3.1.1.RELEASE org.springframework.web.portlet-3.1.1....
org.springframework.beans-3.0.0.M4.jar
org.springframework.orm-3.0.0.M4.jar
org.springframework.orm-3.0.0.RELEASE.jar org.springframework.oxm-3.0.0.RELEASE.jar org.springframework.test-3.0.0.RELEASE.jar org.springframework.transaction-3.0.0.RELEASE.jar org.springframework.web...
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager"> ``` 2. **使用 `@Transactional` 注解**: 在Service层或具体的业务逻辑方法上添加 `@...
org.springframework.orm-3.0.0.RELEASE org.springframework.oxm-3.0.0.RELEASE org.springframework.spring-library-3.0.0.RELEASE org.springframework.test-3.0.0.RELEASE org.springframework.transaction-...
org.springframework.orm-3.0.0.M4.jar: 整合第三方的ORM框架,如hibernate,ibatis,jdo,以及spring的JPA实现 org.springframework.transaction-3.0.0.M4.jar: 为JDBC、Hibernate、JDO、JPA等提供的一致的声明式和...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/...
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <value>classpath:SqlMapConfig.xml <bean id="dao" class="org.springframework.orm.ibatis....
org.springframework.instrument-3.0.5.RELEASE.jar,org.springframework.jdbc-3.0.5.RELEASE.jar,org.springframework.jms-3.0.5.RELEASE.jar,org.springframework.orm-3.0.5.RELEASE.jar,org.springframework....
org.springframework.orm-3.1.0.RELEASE.jar org.springframework.oxm-3.1.0.RELEASE.jar org.springframework.test-3.1.0.RELEASE.jar org.springframework.transaction-3.1.0.RELEASE.jar org.springframework.web...