Hello,
I have two webapps, that are built together and respectively provide a client and admin access to a database.
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.
Has anybody already done something similar?
Here is a part of the XML configuration file:
<bean id="tempEntityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:dataSource-ref="tempDataSource" p:persistenceUnitName="tempJpa" >
<property name="jpaVendorAdapter">
<bean
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:database="ORACLE"
p:databasePlatform="org.hibernate.dialect.Oracle9iDialect"
p:showSql="false" />
</property>
<property name="jpaProperties">
<props>
<prop key="hibernate.hbm2ddl.auto">validate</prop>
</props>
</property>
</bean>
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...
The JPA spec speaks about entity-listeners XML elements, but I can't find a way to inject them in the available Spring elements...
I'm fairly new to Spring, so I may well have misunderstood something... Thanks for your help!