-
Notifications
You must be signed in to change notification settings - Fork 373
cosmetic doc improvements for jdbc component #2148
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
Open
NathanQingyangXu
wants to merge
1
commit into
spring-projects:main
Choose a base branch
from
NathanQingyangXu:cosmetic-doc-improvements-jdbc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
This section offers some specific information about the implementation and use of Spring Data JDBC. | ||
|
||
Most of the data access operations you usually trigger on a repository result in a query being run against the databases. | ||
Most of the data access operations you usually trigger on a repository result in a query being run against the database. | ||
Defining such a query is a matter of declaring a method on the repository interface, as the following example shows: | ||
|
||
.PersonRepository with query methods | ||
|
@@ -36,7 +36,7 @@ interface PersonRepository extends PagingAndSortingRepository<Person, String> { | |
The query is derived by parsing the method name for constraints that can be concatenated with `And` and `Or`. | ||
Thus, the method name results in a query expression of `SELECT … FROM person WHERE firstname = :firstname`. | ||
<2> Use `Pageable` to pass offset and sorting parameters to the database. | ||
<3> Return a `Slice<Person>`.Selects `LIMIT+1` rows to determine whether there's more data to consume. `ResultSetExtractor` customization is not supported. | ||
<3> Return a `Slice<Person>`. Selects `LIMIT+1` rows to determine whether there's more data to consume. `ResultSetExtractor` customization is not supported. | ||
<4> Run a paginated query returning `Page<Person>`.Selects only data within the given page bounds and potentially a count query to determine the total count. `ResultSetExtractor` customization is not supported. | ||
<5> Find a single entity for the given criteria. | ||
It completes with `IncorrectResultSizeDataAccessException` on non-unique results. | ||
|
@@ -143,7 +143,7 @@ NOTE: Query derivation is limited to properties that can be used in a `WHERE` cl | |
|
||
The JDBC module supports defining a query manually as a String in a `@Query` annotation or as named query in a property file. | ||
|
||
Deriving a query from the name of the method is is currently limited to simple properties, that means properties present in the aggregate root directly. | ||
Deriving a query from the name of the method is currently limited to simple properties, that means properties present in the aggregate root directly. | ||
Also, only select queries are supported by this approach. | ||
|
||
[[jdbc.query-methods.at-query]] | ||
|
@@ -164,12 +164,12 @@ interface UserRepository extends CrudRepository<User, Long> { | |
For converting the query result into entities the same `RowMapper` is used by default as for the queries Spring Data JDBC generates itself. | ||
The query you provide must match the format the `RowMapper` expects. | ||
Columns for all properties that are used in the constructor of an entity must be provided. | ||
Columns for properties that get set via setter, wither or field access are optional. | ||
Columns for properties that get set via setter or field access are optional. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure about the |
||
Properties that don't have a matching column in the result will not be set. | ||
The query is used for populating the aggregate root, embedded entities and one-to-one relationships including arrays of primitive types which get stored and loaded as SQL-array-types. | ||
Separate queries are generated for maps, lists, sets and arrays of entities. | ||
|
||
Properties one-to-one relationships must have there name prefixed by the name of the relationship plus `_`. | ||
Properties one-to-one relationships must have their name prefixed by the name of the relationship plus `_`. | ||
For example if the `User` from the example above has an `address` with the property `city` the column for that `city` must be labeled `address_city`. | ||
|
||
|
||
|
@@ -190,7 +190,7 @@ Person findWithSpEL(PersonRef person); | |
---- | ||
|
||
This can be used to access members of a parameter, as demonstrated in the example above. | ||
For more involved use cases an `EvaluationContextExtension` can be made available in the application context, which in turn can make any object available in to the SpEL. | ||
For more involved use cases an `EvaluationContextExtension` can be made available in the application context, which in turn can make any object available in the SpEL. | ||
|
||
The other variant can be used anywhere in the query and the result of evaluating the query will replace the expression in the query string. | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 assume the intention was to insert a hard line break here. Currently, a literal "+" is displayed in the resulting doc instead.