Skip to content
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

Fix parse error on attribute from @Inheritance superclass in spring-data extension #18266

Merged
merged 1 commit into from
Jun 30, 2021
Merged

Fix parse error on attribute from @Inheritance superclass in spring-data extension #18266

merged 1 commit into from
Jun 30, 2021

Conversation

famod
Copy link
Member

@famod famod commented Jun 30, 2021

Fixes the following exception when the method name targets an attribute from a SINGLE_TABLE superclass (here: key):

io.quarkus.spring.data.deployment.UnableToParseMethodException: Entity io.quarkus.it.spring.data.jpa.FederalStateCatalogValue does not contain a field named: key. Offending method is findByKey of Repository io.quarkus.it.spring.data.jpa.FederalStateCatalogValueRepository.
	at io.quarkus.spring.data.deployment.MethodNameParser.resolveNestedField(MethodNameParser.java:372)
	at io.quarkus.spring.data.deployment.MethodNameParser.parse(MethodNameParser.java:202)
	at io.quarkus.spring.data.deployment.generate.DerivedMethodsAdder.add(DerivedMethodsAdder.java:114)
	at io.quarkus.spring.data.deployment.generate.SpringDataRepositoryCreator.implementCrudRepository(SpringDataRepositoryCreator.java:116)
	at io.quarkus.spring.data.deployment.SpringDataJPAProcessor.implementCrudRepositories(SpringDataJPAProcessor.java:273)
	at io.quarkus.spring.data.deployment.SpringDataJPAProcessor.build(SpringDataJPAProcessor.java:107)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476)
	at java.base/java.lang.Thread.run(Thread.java:834)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

The test only covers SINGLE_TABLE but we can always iterate later on JOINED and TABLE_PER_CLASS.

@famod famod requested a review from geoand June 30, 2021 11:52
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 30, 2021

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@quarkus-bot quarkus-bot bot added the area/spring Issues relating to the Spring integration label Jun 30, 2021
@geoand geoand changed the title spring-data-jpa: fix parse error on attribute from @Inheritance superclass Fix parse error on attribute from @Inheritance superclass in spring-data extension Jun 30, 2021
Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@geoand geoand added triage/backport? triage/waiting-for-ci Ready to merge when CI successfully finishes labels Jun 30, 2021
@gsmet gsmet merged commit b72f9c8 into quarkusio:main Jun 30, 2021
@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jun 30, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jun 30, 2021
@famod famod deleted the spring-data-jpa-fix-inheritance branch June 30, 2021 13:11
@gsmet gsmet modified the milestones: 2.1 - main, 2.0.1.Final Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/spring Issues relating to the Spring integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants