EntityManager uses jakarta package not javax

This commit is contained in:
Glenn Renfro
2024-01-02 09:28:56 -05:00
parent 7cd9863a51
commit 25babdf582
2 changed files with 2 additions and 2 deletions

View File

@@ -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();

View File

@@ -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