openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m.@logemann.org
Subject bootstrapping OpenJPA with Spring
Date Mon, 28 Aug 2006 16:08:58 GMT
Hi,

i wonder why there is no OpenJPA-JpaVendorAdapter in the Spring 2.0  
distro. As you can see at  
http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/orm/jpa/vendor/package-summary.html
at least hibernate and toplink provide these.

With this you could easily bootstrap OpenJPA while providing _your  
own_ Spring managed DataSource like this:

<bean id="entityManagerFactory"  
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="persistenceUnitName">
         <value>springJpaPU</value>
       </property>
       <property name="dataSource" ref="dataSource"/>
       <property name="jpaVendorAdapter">
          <bean  
class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
             <property name="showSql" value="true"/>
             <property name="generateDdl" value="true"/>
             <property name="databasePlatform"  
value="oracle.toplink.essentials.platform.database.oracle.OraclePlatform.OraclePlatform"/>
          </bean>
       </property>
    </bean>

Of course with OpenJPA it would be OpenJPAJpaVendorAdapter instead of  
the  Toplink one. I am also missing this for JDO bootstrapping with  
Kodo4 but thats a different story and not for this list.

Is there something planned? IMO with the default Spring way of  
bootstrapping via LocalEntityManagerFactoryBean (which results in  
JavaEE SPI discovery), you cant provide your own DataSource to OpenJPA.

Should i take the time to look into that, or are you guys planning a  
different bootstrapping story for Spring?

Marc Logemann
http://www.logemann.org


Mime
View raw message