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

Specify parameter-based queries/methods in spec doc #266

Conversation

njr-11
Copy link
Contributor

@njr-11 njr-11 commented Sep 18, 2023

Continue the work to fully specify parameter-based queries/methods. This adds on to work done in #260 (precedence rules in spec) and #263 (include in JavaDoc) to ensure these are fully specified in the specification document and that the JavaDoc is consistent with it.

@njr-11 njr-11 added the documentation Improvements or additions to documentation label Sep 18, 2023
@njr-11 njr-11 added this to the Jakarta Data 1.0 milestone Sep 18, 2023
=== Special Parameter Handling
==== Query by Parameters

The Query by Parameters pattern determines the query conditions from the names of the method's parameters that are not of type `Limit`, `Sort`, and `Pageable`. Each query condition is an equality comparison, comparing the parameter value against the value of the entity attribute whose name matches the method parameter name. For embedded attributes, the `_` character is used as the delimiter in the method parameter name. All query conditions are implicitly joined by the `And` operator, such that all must match for an entity to be considered matching.
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we got this discussion somewhere before; annotations such as "Find" could get more flexibility in this case:

https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html#generated-finder-methods

Copy link
Contributor

Choose a reason for hiding this comment

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

I found it: #223

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess we got this discussion somewhere before; annotations such as "Find" could get more flexibility in this case:

It's certainly true that including annotations could add more flexibility here. However, that's a separate proposal, or separate aspect of a proposal, to consider and discuss separately and is not intended to be addressed by this pull. The scope of this pull is to specify what is described under your pull #260 where it states "determining the query from the supplied parameters and the insert, update, delete, find, count, or exists prefix. Query by parameters constructs queries based on method parameters and prefixes."

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I remember this PR, and that is my point: Does it make sense to have insert and update methods?
Should we update to use "DataAcessObject" instead of Repository?

IMHO: we should remove the insert and update and abstract with "save" for a while.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I remember this PR, and that is my point: Does it make sense to have insert and update methods? Should we update to use "DataAcessObject" instead of Repository?

IMHO: we should remove the insert and update and abstract with "save" for a while.

Well, I'm certainly not happy that I wasted all this effort documenting insert/update based on the fact that your pull added them so I thought you were in favor of them. But if you insist on removing them now, I'll update this pull to do so.

Copy link
Contributor Author

@njr-11 njr-11 Sep 19, 2023

Choose a reason for hiding this comment

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

@otaviojava I removed insert and update for you: a83a9d2

@njr-11 njr-11 force-pushed the 255-define-parameter-based-methods-in-spec-doc branch from da6993e to a83a9d2 Compare September 19, 2023 21:55
@otaviojava otaviojava merged commit 12ca283 into jakartaee:main Sep 20, 2023
@KyleAure KyleAure mentioned this pull request Sep 20, 2023
2 tasks
@njr-11 njr-11 mentioned this pull request Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants