-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
update guide-java-spring-boot #16128
Conversation
/label 2024-tidb-docs-dash |
|
||
Spring Data JPA 通过 `@Repository` 接口来管理数据。你需要继承 `JpaRepository` 接口,以使用其提供的增删改查函数。 | ||
通过继承 `JpaRepository<T, ID>` 接口,注册用于管理实体的Bean;`JpaRepository<T, ID>` 接口也提供了基础的增删改查函数。 |
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.
JpaRepository
为泛型接口的接口名称,<T, ID>
为泛型类型。- 并非接口提供增删改查函数,此处是由 Spring IoC 后提供实现类的自动装配。换言之,是由实现类提供的基础增删改查。
注册用于管理实体的Bean
,此句将产生模糊指代。实体、Bean 均可指代PlayerBean
,且 Bean 请替换措辞。
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.
写成这样可以吗?
PlayerRepository
通过继承JpaRepository
接口, 由JpaRepositoryFactoryBean
为其自动注册对应的 Repository Bean。同时,JpaRepository
接口的默认实现类SimpleJpaRepository
提供了增删改查函数的具体实现。
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.
LGTM
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.
LGTM
[LGTM Timeline notifier]Timeline:
|
感谢 @Weaxs 对 TiDB 文档的贡献。 |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiancai The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
First-time contributors' checklist
What is changed, added or deleted? (Required)
Fix #15778
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions (in Chinese).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?