Auto-configure Hibernate JPA before DataSource TransactionManager
Fixes gh-38861
This commit is contained in:
parent
513448e061
commit
b00d5fabe8
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -23,6 +23,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
|
|||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
|
@ -37,7 +38,8 @@ import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
|||
* @author Andy Wilkinson
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@AutoConfiguration(after = DataSourceAutoConfiguration.class, before = TransactionAutoConfiguration.class)
|
||||
@AutoConfiguration(after = DataSourceAutoConfiguration.class,
|
||||
before = { TransactionAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class })
|
||||
@ConditionalOnClass({ LocalContainerEntityManagerFactoryBean.class, EntityManager.class, SessionImplementor.class })
|
||||
@EnableConfigurationProperties(JpaProperties.class)
|
||||
@Import(HibernateJpaConfiguration.class)
|
||||
|
|
|
|||
Loading…
Reference in New Issue