Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, for any dependency set with @Autowired, you must declare a Spring Bean foreach DAO you will use, and it will be injected at runtime. </p> <p>Maybe these DAO need to have a sessionFactory reference like this:</p> <pre><code>&lt;!-- a dao in which you inject your Hibernate SessionFactory bean by its own id --&gt; &lt;bean id="userDAO" class="com.enterprise.model.dao.UserDAO"&gt; &lt;property name="sessionFactory"&gt; &lt;ref bean="sessionFactoryId" /&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!-- activate the @Repository annotation --&gt; &lt;bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" /&gt; </code></pre> <p>Secondly, maybe you forget to add this inside your Spring XML configuration:</p> <pre><code>&lt;!-- Add JPA support --&gt; &lt;bean id="emf" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt; &lt;property name="loadTimeWeaver"&gt; &lt;bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!-- Add Transaction support --&gt; &lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt; &lt;property name="entityManagerFactory" ref="emf"/&gt; &lt;/bean&gt; </code></pre> <p>Third, your interceptor stuff: </p> <pre><code>&lt;bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"&gt; &lt;property name="interceptors"&gt; &lt;list&gt; &lt;ref bean="openEntityManagerInViewInterceptor"/&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="openEntityManagerInViewInterceptor" class="org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor"&gt; &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload