Files
spring-data-examples/jdbc/basics
Spring Operator ccae97890f #491 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 426 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-22 08:13:14 +01:00
..
2019-03-22 08:13:14 +01:00
2019-03-20 10:10:59 -05:00
2018-05-24 09:42:48 +02:00

== Spring Data JDBC basics

=== SimpleEntityTests

This example demonstrate basic usage of JDBC based repositories.

* The `SimpleEntityTests` demonstrate CRUD operations for an entity without references, just simple properties of various types.

* The `CategoryContext` shows how to configure an application context so that Spring Data JDBC can create repositories.

* The `ApplicationListener` registered in `CategoryContext` demonstrate how to react to events published by Spring Data JDBC and how entities can get manipulated in such event listeners.

=== AggregateTests

This example demonstrates various ways to bend what the standard mapping of Spring Data JDBC can do.

* `AggregateConfiguration.idSetting()` registers an `ApplicationListener` to implement a custom id generation strategy for `LegoSet` and `Manual`.

* `AggregateConfiguration.namingStrategy()` registers a custom `NamingStrategy` in order to map property and class names to database columns and tables.

* The `minimumAge` and `maximumAge` properties show a way to use types which don't have direct mapping to a SQL type, by marking them with `@Transient` and having converted properties for Spring Data JDBC to use.

* The `models` attribute demonstrate mapping of a `Map<simple type, entity>`. It does work out of the box, but in this case the the key of the map should be one attribute of the entity.
This is achieved by providing a custom `NamingStrategy` which maps both to the same database column.

* When the database returns a data type for query which Spring Data JDBC doesn't map out of the box a custom conversion can be registered using a `ConversionCustomizer` as demonstrated in `AggregateContext.conversionCustomizer()`.

* `LegoSetRepository` has methods that utilize `@Query` annotations.

* Note that `Model` is a value class, i.e. it is immutable, and doesn't have an ID.