Skip to content

Add missing hint for QuerydslJpaPredicateExecutor #2673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
christophstrobl opened this issue Oct 19, 2022 · 0 comments
Closed

Add missing hint for QuerydslJpaPredicateExecutor #2673

christophstrobl opened this issue Oct 19, 2022 · 0 comments
Assignees
Labels
theme: aot type: enhancement A general enhancement

Comments

@christophstrobl
Copy link
Member

christophstrobl commented Oct 19, 2022

The QuerydslJpaPredicateExecutor cannot be picked up due to missing reflection configuration.

Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: No fragment found for method public abstract java.util.Optional org.springframework.data.querydsl.QuerydslPredicateExecutor.findOne(com.querydsl.core.types.Predicate)",
    "	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:371) ~[na:na]",
    "	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:235) ~[na:na]",
    "	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:550) ~[data-jpa-kotlin:6.0.0-SNAPSHOT]",
    "	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61) ~[na:na]",
    "	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242) ~[na:na]",
    "	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152) ~[na:na]",
    "	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[data-jpa-kotlin:6.0.0-SNAPSHOT]",
    "	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:163) ~[na:na]",
    "	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[data-jpa-kotlin:6.0.0-SNAPSHOT]",
    "	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[na:na]",
    "	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[data-jpa-kotlin:6.0.0-SNAPSHOT]",
    "	at org.springframework.data.repository.core.support.MethodInvocationValidator.invoke(MethodInvocationValidator.java:94) ~[na:na]",
    "	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[data-jpa-kotlin:6.0.0-SNAPSHOT]",
    "	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:218) ~[na:na]",
    "	at jdk.proxy4.$Proxy52.findOne(Unknown Source) ~[data-jpa-kotlin:na]",

Conditional hint should be

hints.reflection().registerType(QuerydslJpaPredicateExecutor.class,
	hint -> hint.withMembers(MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS)
		.onReachableType(QuerydslPredicateExecutor.class));

smoke test: https://github.com/christophstrobl/spring-aot-smoke-tests/tree/issue/data-jpa-querydsl

@christophstrobl christophstrobl self-assigned this Oct 19, 2022
@mp911de mp911de added the type: enhancement A general enhancement label Oct 19, 2022
mp911de added a commit that referenced this issue Oct 20, 2022
Reformat code.

See: #2673
Original pull request: #2674
@mp911de mp911de added this to the 3.0 RC2 (2022.0.0) milestone Oct 20, 2022
yukharin pushed a commit to yukharin/spring-data-jpa that referenced this issue Nov 1, 2022
yukharin pushed a commit to yukharin/spring-data-jpa that referenced this issue Nov 1, 2022
Reformat code.

See: spring-projects#2673
Original pull request: spring-projects#2674
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants