==============異常開始=============
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>
中加入如下配置烘挫,以對(duì)實(shí)體類所在包進(jìn)行掃描
<property name="packagesToScan" value="com.xxx.xxx">