I'm doing a Spring/Hibernate MVC CRUD project (which can be found here:
CodePudding user response:
<context:component-scan .../>
has nothing to do with Entity scanning. You should leave it as you have it
<context:component-scan base-package="base_package.de" />
Going through your github repo the answer is in spring-mvc-crud-demo-servlet.xml and more specifically in the declaration of sessionFactory
. There you have a property named packagesToScan
and this property should be set to the package of your Entities and not to "controller" as it is right now.
<property name="packagesToScan" value="base_package.de.entity" />