EntityManager uses jakarta package not javax
This commit is contained in:
@@ -141,7 +141,7 @@ public class DefaultTaskConfigurer implements TaskConfigurer {
|
||||
if (this.transactionManager == null) {
|
||||
if (isDataSourceAvailable()) {
|
||||
try {
|
||||
Class.forName("javax.persistence.EntityManager");
|
||||
Class.forName("jakarta.persistence.EntityManager");
|
||||
if (this.context != null && this.context.getBeanNamesForType(EntityManager.class).length > 0) {
|
||||
logger.debug("EntityManager was found, using JpaTransactionManager");
|
||||
this.transactionManager = new JpaTransactionManager();
|
||||
|
||||
@@ -66,7 +66,7 @@ public class DefaultTaskConfigurerTests {
|
||||
DefaultTaskConfigurer defaultTaskConfigurer = new DefaultTaskConfigurer(this.dataSource,
|
||||
TaskProperties.DEFAULT_TABLE_PREFIX, localContext);
|
||||
assertThat(defaultTaskConfigurer.getTransactionManager().getClass().getName())
|
||||
.isEqualTo("org.springframework.jdbc.support.JdbcTransactionManager");
|
||||
.isEqualTo("org.springframework.orm.jpa.JpaTransactionManager");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user