title: How can I configure a JPA EntityListener via a Spring XML configuration file?
body: <p>I have two webapps, that are built together and respectively provide a client and admin access to a database.</p>
  
  <p>I'd like to register two JPA EntityListeners to a given class, one in each app. To do that, I'm trying to find a way to register the listeners via the Spring XML configuration file that configure each app's JPA context... and just cannot find any way.</p>
  
  <p>Has anybody already done something similar?</p>
  
  <p>Here is a part of the XML configuration file:</p>
  
  <pre><code>&lt;bean id="tempEntityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
    p:dataSource-ref="tempDataSource" p:persistenceUnitName="tempJpa" &gt;
  
    &lt;property name="jpaVendorAdapter"&gt;
      &lt;bean
        class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
        p:database="ORACLE" 
        p:databasePlatform="org.hibernate.dialect.Oracle9iDialect"
        p:showSql="false"   /&gt;
    &lt;/property&gt;
  
    &lt;property name="jpaProperties"&gt;
      &lt;props&gt;
        &lt;prop key="hibernate.hbm2ddl.auto"&gt;validate&lt;/prop&gt;
      &lt;/props&gt;
    &lt;/property&gt;
  
  &lt;/bean&gt;
  </code></pre>
  
  <p>I thought that there was a way to register a listener around these elements, especially JPAProperties, since it seems to be the place to set JPA configuration elements... </p>
  
  <p>The JPA spec speaks about entity-listeners XML elements, but I can't find a way to inject them in the available Spring elements... </p>
  
  <p>I'm fairly new to Spring, so I may well have misunderstood something... Thanks for your help!</p>