Skip to content

Conversation

@starksm64
Copy link
Member

This prototypes a library tool that parses a Query by name method name using an Antlr4 generated parser and a grammar based on the current spec "BNF Grammar for Query Methods" section.

Signed-off-by: Scott M Stark <starksm64@gmail.com>
@starksm64 starksm64 marked this pull request as draft March 6, 2024 10:02
starksm64 and others added 4 commits April 2, 2024 22:43
Signed-off-by: Scott M Stark <starksm64@gmail.com>
Signed-off-by: Scott M Stark <starksm64@gmail.com>
Signed-off-by: Scott M Stark <starksm64@gmail.com>
@starksm64
Copy link
Member Author

This has been updated to the latest code we are using to pass the TCK with Hibernate 6.6.0

@starksm64 starksm64 marked this pull request as ready for review April 18, 2024 05:26
@gavinking
Copy link
Member

This has been updated to the latest code we are using to pass the TCK with Hibernate 6.6.0

Awesome.

I hope everyone understands that this is something essentially any implementor of Jakarta Data can use to add support for QbMN.

Set<? extends Element> repositories = roundEnv.getElementsAnnotatedWith(Repository.class);
for (Element repository : repositories) {
String provider = repository.getAnnotation(Repository.class).provider();
if(provider.isEmpty() || provider.equalsIgnoreCase("hibernate")) {
Copy link
Member

Choose a reason for hiding this comment

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

I hope everyone understands that this is something essentially any implementor of Jakarta Data can use to add support for QbMN.

Would this restrict the the use case of this tool to hibernate only?

I'd be interested in a README file to help understand the general use case of this tool for a Jakarta Data provider.

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, that should be parameterized I guess.

@starksm64
Copy link
Member Author

I'll add a README and a parameterization of the provider value(s). The README can have sections for providers that have made use of it to document how it is used.

@KyleAure KyleAure added this to the Jakarta Data Future milestone Apr 22, 2024
@Tomas-Kraus
Copy link

Tomas-Kraus commented May 8, 2024

Well, query method by name is regular grammar, something, that should be parsed by regular expression or state machine. Why to build this whole LL(k) context-freee grammar monster which needes at least recursive descend parser?
I solved this just using AntLR 4 lexer grammar with few states.

It's nice to have some sample QbMN parser and some additional tooling, but keep in mind that this is specification + API project.
Support libraries and additional tooling should have their own project(s).

@otaviojava
Copy link
Contributor

Does it still need ?

Can we close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants