Spring Boot
is configured in
com.fillmore_labs.example.spring_data.main
.
DatabaseConfiguration
is separated to be easily referenced in
tests.
💡
|
For a more fine-grained approach and a little extra speed, and we use …Marker -classes (see
basePackageClasses)
and
spring-context-indexer .
|
The Application is configured in
com.fillmore_labs.example.spring_data.config
,
currently only used in
HelloWorld
.
It’s just an example to demonstrate custom typesafe,
@Immutable
configuration with Spring.
💡
|
Since a configuration is a Spring Bean, we can either use Jakarta Bean Validation 2.0, or the parameters could be validated in the constructor. |
We use Jakarta Persistence 2.2 with
Querydsl,
entities are in
com.fillmore_labs.example.spring_data.entity
.
ℹ️
|
For equals() and hashCode() see the references.
|
Spring Data REST
repositories are defined in
com.fillmore_labs.example.spring_data.repository
and are automatically exported.
You need Bazelisk installed, see also Installing Bazel using Bazelisk.
Using Chocolatey enter
choco install bazelisk
Enable developer mode:
-
Open Windows settings
-
Go to “Update & security”, then “For developers”
-
Under “Developer Mode” section enable “Install apps from any source, including loose files”.
or run with administrator privileges.
The main app simply runs two
CommandLineRunners
,
HelloWorld
and
Create
:
bazelisk run //:spring-data
When you want to try the REST API,
Spring Data REST HAL Explorer
at http://127.0.0.1:8080/ and the H2 console at http://127.0.0.1:8080/h2-console (JDBC URL
is
jdbc:h2:mem:testdb
), run
bazelisk run //:spring-data-rest