Skip to content

Commit 933c8db

Browse files
committed
Bundle Javadoc with Antora documentation site.
Closes #1846
1 parent 94fcdc5 commit 933c8db

File tree

10 files changed

+47
-33
lines changed

10 files changed

+47
-33
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ target/
99
.sonar4clipse
1010
*.sonar4clipseExternals
1111
*.graphml
12-
*.json
12+
package-lock.json
1313
.mvn/.gradle-enterprise
1414

1515
build/
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"dependencies": {
3+
"antora": "3.2.0-alpha.6",
4+
"@antora/atlas-extension": "1.0.0-alpha.2",
5+
"@antora/collector-extension": "1.0.0-alpha.7",
6+
"@asciidoctor/tabs": "1.0.0-beta.6",
7+
"@springio/antora-extensions": "1.13.0",
8+
"@springio/asciidoctor-extensions": "1.0.0-alpha.11"
9+
}
10+
}

spring-data-jdbc-distribution/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</plugin>
5151

5252
<plugin>
53-
<groupId>io.spring.maven.antora</groupId>
53+
<groupId>org.antora</groupId>
5454
<artifactId>antora-maven-plugin</artifactId>
5555
</plugin>
5656
</plugins>

src/main/antora/antora-playbook.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# The purpose of this Antora playbook is to build the docs in the current branch.
44
antora:
55
extensions:
6-
- '@antora/collector-extension'
7-
- require: '@springio/antora-extensions/root-component-extension'
6+
- require: '@springio/antora-extensions'
87
root_component_name: 'data-relational'
98
site:
109
title: Spring Data Relational
@@ -22,13 +21,12 @@ content:
2221
start_path: src/main/antora
2322
asciidoc:
2423
attributes:
25-
page-pagination: ''
2624
hide-uri-scheme: '@'
2725
tabs-sync-option: '@'
28-
chomp: 'all'
2926
extensions:
3027
- '@asciidoctor/tabs'
3128
- '@springio/asciidoctor-extensions'
29+
- '@springio/asciidoctor-extensions/javadoc-extension'
3230
sourcemap: true
3331
urls:
3432
latest_version_segment: ''
@@ -38,5 +36,5 @@ runtime:
3836
format: pretty
3937
ui:
4038
bundle:
41-
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
39+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.16/ui-bundle.zip
4240
snapshot: true

src/main/antora/antora.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ ext:
1010
local: true
1111
scan:
1212
dir: spring-data-jdbc-distribution/target/classes/
13+
- run:
14+
command: ./mvnw package -Pdistribute
15+
local: true
16+
scan:
17+
dir: target/antora

src/main/antora/modules/ROOT/nav.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@
4949
** xref:kotlin/extensions.adoc[]
5050
** xref:kotlin/coroutines.adoc[]
5151
52-
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki]
52+
* xref:attachment$api/java/index.html[Javadoc,role=link-external,window=_blank]
53+
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki,role=link-external,window=_blank]

src/main/antora/modules/ROOT/pages/jdbc/events.adoc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Events and callbacks get only triggered for aggregate roots.
99
If you want to process non-root entities, you need to do that through a listener for the containing aggregate root.
1010

1111
Entity lifecycle events can be costly, and you may notice a change in the performance profile when loading large result sets.
12-
You can disable lifecycle events on the link:{spring-data-jdbc-javadoc}org/springframework/data/jdbc/core/JdbcAggregateTemplate.html#setEntityLifecycleEventsEnabled(boolean)[Template API].
12+
You can disable lifecycle events on javadoc:org.springframework.data.jdbc.core.JdbcAggregateTemplate#setEntityLifecycleEventsEnabled(boolean)[Template API].
1313

1414
For example, the following listener gets invoked before an aggregate gets saved:
1515

@@ -46,22 +46,22 @@ The following table describes the available events.For more details about the ex
4646
|===
4747
| Event | When It Is Published
4848

49-
| {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/event/BeforeDeleteEvent.html[`BeforeDeleteEvent`]
49+
| javadoc:org.springframework.data.relational.core.mapping.event.BeforeDeleteEvent[]
5050
| Before an aggregate root gets deleted.
5151

52-
| {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/event/AfterDeleteEvent.html[`AfterDeleteEvent`]
52+
| javadoc:org.springframework.data.relational.core.mapping.event.AfterDeleteEvent[]
5353
| After an aggregate root gets deleted.
5454

55-
| {spring-data-jdbc-javadoc}/org/springframework/data/relational/core/mapping/event/BeforeConvertEvent.html[`BeforeConvertEvent`]
55+
| javadoc:org.springframework.data.relational.core.mapping.event.BeforeConvertEvent[]
5656
| Before an aggregate root gets converted into a plan for executing SQL statements, but after the decision was made if the aggregate is new or not, i.e. if an update or an insert is in order.
5757

58-
| {spring-data-jdbc-javadoc}/org/springframework/data/relational/core/mapping/event/BeforeSaveEvent.html[`BeforeSaveEvent`]
58+
| javadoc:org.springframework.data.relational.core.mapping.event.BeforeSaveEvent[]
5959
| Before an aggregate root gets saved (that is, inserted or updated but after the decision about whether if it gets inserted or updated was made).
6060

61-
| {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/event/AfterSaveEvent.html[`AfterSaveEvent`]
61+
| javadoc:org.springframework.data.relational.core.mapping.event.AfterSaveEvent[]
6262
| After an aggregate root gets saved (that is, inserted or updated).
6363

64-
| {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/event/AfterConvertEvent.html[`AfterConvertEvent`]
64+
| javadoc:org.springframework.data.relational.core.mapping.event.AfterConvertEvent[]
6565
| After an aggregate root gets created from a database `ResultSet` and all its properties get set.
6666
|===
6767

@@ -77,33 +77,33 @@ Spring Data JDBC uses the xref:commons/entity-callbacks.adoc[`EntityCallback` AP
7777
|===
7878
| Process | `EntityCallback` / Process Step | Comment
7979

80-
.3+| Delete | {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/event/BeforeDeleteCallback.html[`BeforeDeleteCallback`]
80+
.3+| Delete | javadoc:org.springframework.data.relational.core.mapping.event.BeforeDeleteCallback[]
8181
| Before the actual deletion.
8282

8383
2+| The aggregate root and all the entities of that aggregate get removed from the database.
8484

85-
| {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/event/AfterDeleteCallback.html[`AfterDeleteCallback`]
85+
| javadoc:org.springframework.data.relational.core.mapping.event.AfterDeleteCallback[]
8686
| After an aggregate gets deleted.
8787

8888

89-
.6+| Save 2+| Determine if an insert or an update of the aggregate is to be performed dependen on if it is new or not.
90-
| {spring-data-jdbc-javadoc}/org/springframework/data/relational/core/mapping/event/BeforeConvertCallback.html[`BeforeConvertCallback`]
89+
.6+| Save 2+| Determine if an insert or an update of the aggregate is to be performed dependent on if it is new or not.
90+
| javadoc:org.springframework.data.relational.core.mapping.event.BeforeConvertCallback[]
9191
| This is the correct callback if you want to set an id programmatically. In the previous step new aggregates got detected as such and a Id generated in this step would be used in the following step.
9292

9393
2+| Convert the aggregate to a aggregate change, it is a sequence of SQL statements to be executed against the database. In this step the decision is made if an Id is provided by the aggregate or if the Id is still empty and is expected to be generated by the database.
9494

95-
| {spring-data-jdbc-javadoc}/org/springframework/data/relational/core/mapping/event/BeforeSaveCallback.html[`BeforeSaveCallback`]
95+
| javadoc:org.springframework.data.relational.core.mapping.event.BeforeSaveCallback[]
9696
| Changes made to the aggregate root may get considered, but the decision if an id value will be sent to the database is already made in the previous step.
9797
Do not use this for creating Ids for new aggregates. Use `BeforeConvertCallback` instead.
9898

9999
2+| The SQL statements determined above get executed against the database.
100100

101-
| {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/event/AfterSaveCallback.html[`AfterSaveCallback`]
101+
| javadoc:org.springframework.data.relational.core.mapping.event.AfterSaveCallback[]
102102
| After an aggregate root gets saved (that is, inserted or updated).
103103

104104

105105
.2+| Load 2+| Load the aggregate using 1 or more SQL queries. Construct the aggregate from the resultset.
106-
| {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/event/AfterConvertCallback.html[`AfterConvertCallback`]
106+
| javadoc:org.springframework.data.relational.core.mapping.event.AfterConvertCallback[]
107107
|
108108
|===
109109

src/main/antora/modules/ROOT/pages/jdbc/getting-started.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class ApplicationConfig extends AbstractJdbcConfiguration {
129129
----
130130

131131
<1> `@EnableJdbcRepositories` creates implementations for interfaces derived from `Repository`
132-
<2> `AbstractJdbcConfiguration` provides various default beans required by Spring Data JDBC
132+
<2> javadoc:org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration[] provides various default beans required by Spring Data JDBC
133133
<3> Creates a `DataSource` connecting to a database.
134134
This is required by the following two bean methods.
135135
<4> Creates the `NamedParameterJdbcOperations` used by Spring Data JDBC to access the database.
@@ -139,7 +139,7 @@ The configuration class in the preceding example sets up an embedded HSQL databa
139139
The `DataSource` is then used to set up `NamedParameterJdbcOperations` and a `TransactionManager`.
140140
We finally activate Spring Data JDBC repositories by using the `@EnableJdbcRepositories`.
141141
If no base package is configured, it uses the package in which the configuration class resides.
142-
Extending `AbstractJdbcConfiguration` ensures various beans get registered.
142+
Extending javadoc:org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration[] ensures various beans get registered.
143143
Overwriting its methods can be used to customize the setup (see below).
144144

145145
This configuration can be further simplified by using Spring Boot.
@@ -152,7 +152,7 @@ There are a couple of things one might want to customize in this setup.
152152
== Dialects
153153

154154
Spring Data JDBC uses implementations of the interface `Dialect` to encapsulate behavior that is specific to a database or its JDBC driver.
155-
By default, the `AbstractJdbcConfiguration` attempts to determine the dialect from the database configuration by obtaining a connection and registering the correct `Dialect`.
155+
By default, the javadoc:org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration[] attempts to determine the dialect from the database configuration by obtaining a connection and registering the correct `Dialect`.
156156
You override `AbstractJdbcConfiguration.jdbcDialect(NamedParameterJdbcOperations)` to customize dialect selection.
157157

158158
If you use a database for which no dialect is available, then your application won’t start up.
@@ -161,8 +161,8 @@ Alternatively, you can implement your own `Dialect`.
161161

162162
[TIP]
163163
====
164-
Dialects are resolved by {spring-data-jdbc-javadoc}/org/springframework/data/jdbc/repository/config/DialectResolver.html[`DialectResolver`] from a `JdbcOperations` instance, typically by inspecting `Connection.getMetaData()`.
165-
+ You can let Spring auto-discover your `JdbcDialect` by registering a class that implements `org.springframework.data.jdbc.repository.config.DialectResolver$JdbcDialectProvider` through `META-INF/spring.factories`.
164+
Dialects are resolved by javadoc:org.springframework.data.jdbc.repository.config.DialectResolver[] from a `JdbcOperations` instance, typically by inspecting `Connection.getMetaData()`.
165+
+ You can let Spring auto-discover your javadoc:org.springframework.data.jdbc.core.dialect.JdbcDialect[] by registering a class that implements `org.springframework.data.jdbc.repository.config.DialectResolver$JdbcDialectProvider` through `META-INF/spring.factories`.
166166
`DialectResolver` discovers dialect provider implementations from the class path using Spring's `SpringFactoriesLoader`.
167167
To do so:
168168

src/main/antora/modules/ROOT/pages/jdbc/transactions.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
The methods of `CrudRepository` instances are transactional by default.
55
For reading operations, the transaction configuration `readOnly` flag is set to `true`.
66
All others are configured with a plain `@Transactional` annotation so that default transaction configuration applies.
7-
For details, see the Javadoc of link:{spring-data-jdbc-javadoc}org/springframework/data/jdbc/repository/support/SimpleJdbcRepository.html[`SimpleJdbcRepository`].
7+
For details, see the Javadoc of javadoc:org.springframework.data.jdbc.repository.support.SimpleJdbcRepository[].
88
If you need to tweak transaction configuration for one of the methods declared in a repository, redeclare the method in your repository interface, as follows:
99

1010
.Custom transaction configuration for CRUD

src/main/antora/modules/ROOT/partials/mapping.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
By convention, Spring Data applies a `NamingStrategy` to determine table, column, and schema names defaulting to https://en.wikipedia.org/wiki/Snake_case[snake case].
55
An object property named `firstName` becomes `first_name`.
6-
You can tweak that by providing a {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/NamingStrategy.html[`NamingStrategy`] in your application context.
6+
You can tweak that by providing a javadoc:org.springframework.data.relational.core.mapping.NamingStrategy[] in your application context.
77

88
[[entity-persistence.custom-table-name]]
99
== Override table names
1010

11-
When the table naming strategy does not match your database table names, you can override the table name with the {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/Table.html[`@Table`] annotation.
11+
When the table naming strategy does not match your database table names, you can override the table name with the javadoc:org.springframework.data.relational.core.mapping.Table[] annotation.
1212
The element `value` of this annotation provides the custom table name.
1313
The following example maps the `MyEntity` class to the `CUSTOM_TABLE_NAME` table in the database:
1414

@@ -26,7 +26,7 @@ class MyEntity {
2626
[[entity-persistence.custom-column-name]]
2727
== Override column names
2828

29-
When the column naming strategy does not match your database table names, you can override the table name with the {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/Column.html[`@Column`] annotation.
29+
When the column naming strategy does not match your database table names, you can override the table name with the javadoc:org.springframework.data.relational.core.mapping.Column[] annotation.
3030
The element `value` of this annotation provides the custom column name.
3131
The following example maps the `name` property of the `MyEntity` class to the `CUSTOM_COLUMN_NAME` column in the database:
3232

@@ -43,7 +43,7 @@ class MyEntity {
4343

4444
ifdef::mapped-collection[]
4545

46-
The {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/MappedCollection.html[`@MappedCollection`]
46+
The javadoc:org.springframework.data.relational.core.mapping.MappedCollection[]
4747
annotation can be used on a reference type (one-to-one relationship) or on Sets, Lists, and Maps (one-to-many relationship).
4848
`idColumn` element of the annotation provides a custom name for the foreign key column referencing the id column in the other table.
4949
In the following example the corresponding table for the `MySubEntity` class has a `NAME` column, and the `CUSTOM_MY_ENTITY_ID_COLUMN_NAME` column of the `MyEntity` id for relationship reasons:
@@ -64,7 +64,7 @@ class MySubEntity {
6464
----
6565

6666
When using `List` and `Map` you must have an additional column for the position of a dataset in the `List` or the key value of the entity in the `Map`.
67-
This additional column name may be customized with the `keyColumn` Element of the {spring-data-jdbc-javadoc}org/springframework/data/relational/core/mapping/MappedCollection.html[`@MappedCollection`] annotation:
67+
This additional column name may be customized with the `keyColumn` Element of the javadoc:org.springframework.data.relational.core.mapping.MappedCollection[] annotation:
6868

6969
[source,java]
7070
----

0 commit comments

Comments
 (0)