6

MyBatis で Spring Data JPA を使用しようとしています。MyBatis 用のベンダー アダプターがないため、代替手段は何ですか?

<bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="packagesToScan" value="com.abc.xyz.domain"/>
</bean>

アプリケーションを初期化しようとすると、以下の例外が発生します。

Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No PersistenceProvider specified in EntityManagerFactory configuration, and chosen PersistenceUnitInfo does not specify a provider class name either

ありがとう

4

5 に答える 5

2

spring-data-jpa-extra を試してみませんか

mybatis のような spring-data-jpa の動的クエリ ソリューションを提供しますが、mybatis よりもはるかに簡単です。

私はあなたがそれを好むと思います:)

于 2016-05-07T17:11:50.230 に答える
2

春のデータ MyBatis

Spring-Data-JPAモジュールのような JPA 実装を使用したくないが、Spring- Dataを使用したい場合は、 Spring-Data-Mybatが便利なプロジェクトであることがわかります 。

これがあなたの質問に対する正確な回答ではないことは承知していますが、この回答が興味深いものになることを願っています。

于 2016-05-11T15:49:25.380 に答える