==============异常开始=============
java.lang.IllegalArgumentException: Not an entity: class com.xxx.xxx.xxx.xxx
at org.hibernate.ejb.metamodel.MetamodelImpl.entity(MetamodelImpl.java:179)
at org.hibernate.ejb.criteria.QueryStructure.from(QueryStructure.java:138)
at org.hibernate.ejb.criteria.CriteriaQueryImpl.from(CriteriaQueryImpl.java:179)
。。。。。
解决办法:
在<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"></bean>
中加入如下配置,以对实体类所在包进行扫描
<property name="packagesToScan" value="com.xxx.xxx">