Skip to content

Commit c2073d5

Browse files
committed
Adapt to changed AOT packages in Spring Data Commons.
Closes #2661
1 parent 3a3c937 commit c2073d5

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/aot/JpaRuntimeHints.java renamed to spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/aot/JpaRuntimeHints.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.data.jpa.aot;
16+
package org.springframework.data.jpa.repository.aot;
1717

1818
import java.util.Arrays;
1919

@@ -29,10 +29,12 @@
2929
import org.springframework.util.ClassUtils;
3030

3131
/**
32+
* Runtime hints for JPA AOT processing.
33+
*
3234
* @author Christoph Strobl
3335
* @since 3.0
3436
*/
35-
public class JpaRuntimeHints implements RuntimeHintsRegistrar {
37+
class JpaRuntimeHints implements RuntimeHintsRegistrar {
3638

3739
@Override
3840
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
@@ -49,9 +51,10 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
4951
.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS));
5052

5153
hints.reflection().registerTypes(Arrays.asList( //
52-
TypeReference.of(AuditingBeanFactoryPostProcessor.class), //
53-
TypeReference.of(AuditingEntityListener.class)),
54-
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS));
54+
TypeReference.of(AuditingBeanFactoryPostProcessor.class), //
55+
TypeReference.of(AuditingEntityListener.class)),
56+
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
57+
MemberCategory.INVOKE_DECLARED_METHODS));
5558
}
5659

5760
hints.reflection().registerType(TypeReference.of(SimpleJpaRepository.class),

spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/JpaRepositoryConfigExtension.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646
import org.springframework.core.io.ResourceLoader;
4747
import org.springframework.dao.DataAccessException;
4848
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
49-
import org.springframework.data.aot.AotRepositoryContext;
50-
import org.springframework.data.aot.RepositoryRegistrationAotProcessor;
5149
import org.springframework.data.jpa.repository.JpaRepository;
5250
import org.springframework.data.jpa.repository.support.DefaultJpaContext;
5351
import org.springframework.data.jpa.repository.support.EntityManagerBeanDefinitionRegistrarPostProcessor;
5452
import org.springframework.data.jpa.repository.support.JpaEvaluationContextExtension;
5553
import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean;
54+
import org.springframework.data.repository.aot.AotRepositoryContext;
55+
import org.springframework.data.repository.aot.RepositoryRegistrationAotProcessor;
5656
import org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource;
5757
import org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport;
5858
import org.springframework.data.repository.config.RepositoryConfigurationSource;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
org.springframework.aot.hint.RuntimeHintsRegistrar=\
2-
org.springframework.data.jpa.aot.JpaRuntimeHints
2+
org.springframework.data.jpa.repository.aot.JpaRuntimeHints

spring-data-jpa/src/test/java/org/springframework/data/jpa/aot/JpaRuntimeHintsUnitTests.java renamed to spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/aot/JpaRuntimeHintsUnitTests.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,22 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.data.jpa.aot;
16+
package org.springframework.data.jpa.repository.aot;
1717

1818
import static org.assertj.core.api.AssertionsForClassTypes.*;
19-
import static org.springframework.aot.hint.predicate.RuntimeHintsPredicates.reflection;
19+
import static org.springframework.aot.hint.predicate.RuntimeHintsPredicates.*;
2020

2121
import org.junit.jupiter.api.Test;
22+
2223
import org.springframework.aot.hint.RuntimeHints;
2324
import org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect;
2425
import org.springframework.data.jpa.domain.support.AuditingBeanFactoryPostProcessor;
2526
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
2627
import org.springframework.data.jpa.util.HidingClassLoader;
2728

2829
/**
30+
* Unit tests for {@link JpaRuntimeHints}.
31+
*
2932
* @author Christoph Strobl
3033
*/
3134
class JpaRuntimeHintsUnitTests {

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoryRegistrationAotProcessorUnitTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
3232
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
3333
import org.springframework.core.annotation.MergedAnnotation;
34-
import org.springframework.data.aot.AotRepositoryContext;
34+
import org.springframework.data.repository.aot.AotRepositoryContext;
3535
import org.springframework.data.repository.core.RepositoryInformation;
3636
import org.springframework.javapoet.ClassName;
3737

0 commit comments

Comments
 (0)