Announcement Announcement Module
Collapse
No announcement yet.
How to specify persistence unit in ApplicationContext.xml? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to specify persistence unit in ApplicationContext.xml?

    Here is a fragment from my ApplicationContext.xml file:

    Code:
      <bean id="emf" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
         <property name="loadTimeWeaver"> <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/> </property>
      </bean>
    This works as long as I only have a single Persistence Unit in my persistence.xml. Since I would like to have multiple persistence units to try out different JPA providers, how would I inject the peristence unit name into the emf bean? I cannot determine if we are using constructor injection or setter injection since loadTimeWeaver does not seam to be a constructor argument and I don't see a setter by that name either in that class or the abstract ancestor. http://static.springsource.org/sprin...ctoryBean.html.

    Thanks
    Siegfried
Working...
X