Skip to content

Commit

Permalink
Sync documentation of main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 25, 2024
1 parent 6a62259 commit 07c1585
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
12 changes: 12 additions & 0 deletions _versions/main/guides/datasource.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ For more details and optional configurations, see xref:databases-dev-services.ad

* `quarkus-jdbc-db2`
* `quarkus-jdbc-derby`
ifdef::note-quarkus-derby[]
+
{note-quarkus-derby}
endif::note-quarkus-derby[]
* `quarkus-jdbc-h2`
* `quarkus-jdbc-mariadb`
* `quarkus-jdbc-mssql`
Expand Down Expand Up @@ -151,6 +155,10 @@ Quarkus currently includes the following built-in database kinds:
+
* DB2: `db2`
* Derby: `derby`
ifdef::note-quarkus-derby[]
+
{note-quarkus-derby}
endif::note-quarkus-derby[]
* H2: `h2`
* MariaDB: `mariadb`
* Microsoft SQL Server: `mssql`
Expand Down Expand Up @@ -191,6 +199,10 @@ JDBC is the most common database connection pattern, typically needed when used
.. For use with a built-in JDBC driver, choose and add the Quarkus extension for your relational database driver from the list below:
+
* Derby - `quarkus-jdbc-derby`
ifdef::note-quarkus-derby[]
+
{note-quarkus-derby}
endif::note-quarkus-derby[]
* H2 - `quarkus-jdbc-h2`
+
[NOTE]
Expand Down
4 changes: 3 additions & 1 deletion _versions/main/guides/picocli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ annotationProcessor 'info.picocli:picocli-codegen'

== Development Mode

In the development mode, i.e. when running `mvn quarkus:dev`, the application is executed and restarted every time the `Space bar` key is pressed. You can also pass arguments to your command line app via the `quarkus.args` system property, e.g. `mvn quarkus:dev -Dquarkus.args='--help'` and `mvn quarkus:dev -Dquarkus.args='-c -w --val 1'`. For gradle project arguments can be passed using `--quarkus-args`.
In the development mode, i.e. when running `mvn quarkus:dev`, the application is executed and restarted every time the `Space bar` key is pressed. You can also pass arguments to your command line app via the `quarkus.args` system property, e.g. `mvn quarkus:dev -Dquarkus.args='--help'` and `mvn quarkus:dev -Dquarkus.args='-c -w --val 1'`.
For Gradle projects, arguments can be passed using `--quarkus-args`.

[NOTE]
====
If you're creating a typical Quarkus application (e.g., HTTP-based services) that includes command-line functionality, you'll need to handle the application's lifecycle differently. In the `Runnable.run()` method of your command, make sure to use `Quarkus.waitForExit()` or `Quarkus.asyncExit()`. This will prevent the application from shutting down prematurely and ensure a proper shutdown process.
Expand Down
2 changes: 1 addition & 1 deletion _versions/main/guides/smallrye-graphql-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ to properly qualify the injection point.
If you need to add an authorization header, or any other custom HTTP header (in our case
it's not required), this can be done by:
----
quarkus.smallrye-graphql-client.star-wars-dynamic.header.HEADER-KEY=HEADER-VALUE"
quarkus.smallrye-graphql-client.star-wars-dynamic.header.HEADER-KEY=HEADER-VALUE
----

Add this to the `StarWarsResource` created earlier:
Expand Down
2 changes: 2 additions & 0 deletions _versions/main/guides/spring-data-jpa.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,9 @@ Interfaces that extend any of the following Spring Data repositories are automat

* `org.springframework.data.repository.Repository`
* `org.springframework.data.repository.CrudRepository`
* `org.springframework.data.repository.ListCrudRepository`
* `org.springframework.data.repository.PagingAndSortingRepository`
* `org.springframework.data.repository.ListPagingAndSortingRepository`
* `org.springframework.data.jpa.repository.JpaRepository`

The generated repositories are also registered as beans so they can be injected into any other bean.
Expand Down
17 changes: 15 additions & 2 deletions _versions/main/guides/spring-data-rest.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,15 @@ The former is used by default, but it is highly recommended to specify which one
If a database contains many entities, it might not be a great idea to return them all at once.
`PagingAndSortingRepository` allows the `spring-data-rest` extension to access data in chunks.

Replace the `CrudRepository` with `PagingAndSortingRepository` in the `FruitsRepository`:
So, you can extend the `PagingAndSortingRepository`:

[source,java]
----
package org.acme.spring.data.rest;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface FruitsRepository extends PagingAndSortingRepository<Fruit, Long> {
public interface FruitsRepository extends CrudRepository<Fruit, Long>, PagingAndSortingRepository<Fruit, Long> {
}
----

Expand All @@ -362,6 +362,19 @@ Now the `GET /fruits` will accept three new query parameters: `sort`, `page` and

For paged responses, `spring-data-rest` also returns a set of link headers that can be used to access other pages: first, previous, next and last.

Additionally, rather than extending both `PagingAndSortingRepository` and `CrudRepository`, you can use `JpaRepository`, which is a higher-level abstraction tailored for JPA. Since `JpaRepository` already extends both `PagingAndSortingRepository` and `CrudRepository`, it can replace `CrudRepository` directly.

[source,java]
----
package org.acme.spring.data.rest;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface FruitsRepository extends JpaRepository<Fruit, Long> {
}
----


==== Fine tuning endpoints generation

This allows user to specify which methods should be exposed and what path should be used to access them.
Expand Down

0 comments on commit 07c1585

Please sign in to comment.