-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 some defects in repositories doc #9319
base: main
Are you sure you want to change the base?
fix some defects in repositories doc #9319
Conversation
Thanks for your pull request! This pull request does not follow the contribution rules. Could you have a look? ❌ All commit messages should start with a JIRA issue key matching pattern › This message was automatically generated. |
@@ -16,6 +16,7 @@ public class Book { | |||
@Basic(optional = false) | |||
String title; | |||
|
|||
@Basic(optional = false) | |||
LocalDate publicationDate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found LocalDate
is in the scope of Basic
at https://docs.jboss.org/hibernate/orm/6.6/userguide/html_single/Hibernate_User_Guide.html#basic-basic-annotation:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Nathan, I have left comments.
@@ -126,7 +126,7 @@ It's always possible to instantiate a repository implementation directly. | |||
|
|||
[source,java] | |||
---- | |||
Library library = new Library_(statelessSession); | |||
Library library = new Library(statelessSession); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this one, please.
@@ -113,7 +113,7 @@ This really isn't as bad as it sounds; overuse of lazy fetching is associated wi | |||
A future release of Jakarta Data will feature repositories backed by Jakarta Persistence stateful persistence contexts, but this functionality did not make the cut for Jakarta Data 1.0. | |||
==== | |||
|
|||
The second big difference is that instead of providing a generic interface like `EntityManager` that's capable of performing persistence operations for any entity class, Jakarta Data requires that each interaction with the database go via a user-written method specific to just one entity type. The method is marked with annotations allowing Hibernate to fill in the method implementation. | |||
The second big difference is that instead of providing a generic interface like `EntityManager` that's capable of performing persistence operations for any entity class, Jakarta Data requires that each interaction with the database goes via a user-written method specific to just one entity type. The method is marked with annotations allowing Hibernate to fill in the method implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NathanQingyangXu this sentence is correct! English has a subjunctive mood just like Spanish does. Sure, plenty of English speakers don't use it in spoken English, but it's more correct in written English, and I do use it because I guess I read too much.
Here's what ChatGPT says about that sentence:
Yes, the sentence is grammatically correct. It conveys its meaning clearly and follows standard grammar rules. Here's a breakdown:
Subject-Verb Agreement:
The subject "Jakarta Data" correctly agrees with the verb "requires."
Subjunctive Mood:
The clause "that each interaction with the database go via a user-written method" uses the subjunctive mood correctly. The verb "go" (not "goes") is appropriate here because it's expressing a requirement or necessity.
Modifiers:
"Specific to just one entity type" modifies "method" appropriately, and the meaning is clear.
The sentence is well-constructed for a technical or formal context.
If you ask ChatGPT more about the subjunctive mood in English, I'm sure it will explain it to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR this comes from the same reason you say "if I were ten feet tall" instead of "if I was ten feet tall". Many English speakers will use "was" here, which isn't incorrect, but "were" is more elegant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the detailed explanation. Reverted back.
@@ -60,7 +60,7 @@ annotationProcessor 'org.hibernate.orm:hibernate-processor:7.0.0' | |||
|
|||
=== Excluding classes from processing | |||
|
|||
There's three ways to limit the annotation processor to certain classes: | |||
There are three ways to limit the annotation processor to certain classes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I'm letting you change these because in principle (to a linguistic prescriptivist) "there's three ways" is grammatically "incorrect" in written English. But note that "there's many things" is something that's incredibly common in informal English and this phrase sounds completely correct to a native speaker. I would never ever notice this "mistake" in either written or spoken English.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't have to revert, it was just an observation. I agree it's strictly-speaking incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hehe, then I reverted back the usage of there are ...
. Also, the changes align with the other two docs (Hiberbate 6 introduction and Hibernate Query Language) I'd made similar changes.
Hibernate Data is definitively highly interesting to MongoDB Hibernate integration project for it provides a good selling point to compete with Spring Data Mongo (I used to be a lover of Spring Data's method name based query feature, now I found it is not well-founded and technically Hibernate Data is much more powerful and makes more sense).
I found some obvious defects in the doc, though there are some I am not certain of so I left some comments to confirm.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.