@@ -127,7 +127,7 @@ The Spring Data JDBC repositories support can be activated by an annotation thro
127127class ApplicationConfig extends AbstractJdbcConfiguration { // <2>
128128
129129 @Bean
130- public DataSource dataSource() { // <3>
130+ DataSource dataSource() { // <3>
131131
132132 EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
133133 return builder.setType(EmbeddedDatabaseType.HSQL).build();
@@ -250,13 +250,11 @@ Custom converters can be registered, for types that are not supported by default
250250[source,java]
251251----
252252@Configuration
253- public class DataJdbcConfiguration extends AbstractJdbcConfiguration {
253+ class DataJdbcConfiguration extends AbstractJdbcConfiguration {
254254
255255 @Override
256256 public JdbcCustomConversions jdbcCustomConversions() {
257-
258257 return new JdbcCustomConversions(Collections.singletonList(TimestampTzToDateConverter.INSTANCE));
259-
260258 }
261259
262260 @ReadingConverter
@@ -303,7 +301,7 @@ The following example maps the `MyEntity` class to the `CUSTOM_TABLE_NAME` table
303301[source,java]
304302----
305303@Table("CUSTOM_TABLE_NAME")
306- public class MyEntity {
304+ class MyEntity {
307305 @Id
308306 Integer id;
309307
@@ -322,7 +320,7 @@ The following example maps the `name` property of the `MyEntity` class to the `C
322320====
323321[source,java]
324322----
325- public class MyEntity {
323+ class MyEntity {
326324 @Id
327325 Integer id;
328326
@@ -340,15 +338,15 @@ In the following example the corresponding table for the `MySubEntity` class has
340338====
341339[source,java]
342340----
343- public class MyEntity {
341+ class MyEntity {
344342 @Id
345343 Integer id;
346344
347345 @MappedCollection(idColumn = "CUSTOM_MY_ENTITY_ID_COLUMN_NAME")
348346 Set<MySubEntity> subEntities;
349347}
350348
351- public class MySubEntity {
349+ class MySubEntity {
352350 String name;
353351}
354352----
@@ -360,15 +358,15 @@ This additional column name may be customized with the `keyColumn` Element of th
360358====
361359[source,java]
362360----
363- public class MyEntity {
361+ class MyEntity {
364362 @Id
365363 Integer id;
366364
367365 @MappedCollection(idColumn = "CUSTOM_COLUMN_NAME", keyColumn = "CUSTOM_KEY_COLUMN_NAME")
368366 List<MySubEntity> name;
369367}
370368
371- public class MySubEntity {
369+ class MySubEntity {
372370 String name;
373371}
374372----
@@ -388,7 +386,7 @@ Opposite to this behavior `USE_EMPTY` tries to create a new instance using eithe
388386====
389387[source,java]
390388----
391- public class MyEntity {
389+ class MyEntity {
392390
393391 @Id
394392 Integer id;
@@ -397,7 +395,7 @@ public class MyEntity {
397395 EmbeddedEntity embeddedEntity;
398396}
399397
400- public class EmbeddedEntity {
398+ class EmbeddedEntity {
401399 String name;
402400}
403401----
@@ -414,7 +412,7 @@ Make use of the shortcuts `@Embedded.Nullable` & `@Embedded.Empty` for `@Embedde
414412
415413[source,java]
416414----
417- public class MyEntity {
415+ class MyEntity {
418416
419417 @Id
420418 Integer id;
@@ -610,7 +608,7 @@ The following example shows how to use `@Query` to declare a query method:
610608====
611609[source,java]
612610----
613- public interface UserRepository extends CrudRepository<User, Long> {
611+ interface UserRepository extends CrudRepository<User, Long> {
614612
615613 @Query("select firstName, lastName from User u where u.emailAddress = :email")
616614 User findByEmailAddress(@Param("email") String email);
@@ -828,7 +826,7 @@ For example, the following listener gets invoked before an aggregate gets saved:
828826[source,java]
829827----
830828@Bean
831- public ApplicationListener<BeforeSaveEvent<Object>> loggingSaves() {
829+ ApplicationListener<BeforeSaveEvent<Object>> loggingSaves() {
832830
833831 return event -> {
834832
@@ -845,7 +843,7 @@ Callback methods will only get invoked for events related to the domain type and
845843====
846844[source,java]
847845----
848- public class PersonLoadListener extends AbstractRelationalEventListener<Person> {
846+ class PersonLoadListener extends AbstractRelationalEventListener<Person> {
849847
850848 @Override
851849 protected void onAfterLoad(AfterLoadEvent<Person> personLoad) {
@@ -937,11 +935,11 @@ If you need to tweak transaction configuration for one of the methods declared i
937935====
938936[source,java]
939937----
940- public interface UserRepository extends CrudRepository<User, Long> {
938+ interface UserRepository extends CrudRepository<User, Long> {
941939
942940 @Override
943941 @Transactional(timeout = 10)
944- public List<User> findAll();
942+ List<User> findAll();
945943
946944 // Further query method declarations
947945}
@@ -959,7 +957,7 @@ The following example shows how to create such a facade:
959957[source,java]
960958----
961959@Service
962- class UserManagementImpl implements UserManagement {
960+ public class UserManagementImpl implements UserManagement {
963961
964962 private final UserRepository userRepository;
965963 private final RoleRepository roleRepository;
@@ -999,7 +997,7 @@ To let your query methods be transactional, use `@Transactional` at the reposito
999997[source,java]
1000998----
1001999@Transactional(readOnly = true)
1002- public interface UserRepository extends CrudRepository<User, Long> {
1000+ interface UserRepository extends CrudRepository<User, Long> {
10031001
10041002 List<User> findByLastname(String lastname);
10051003
@@ -1035,7 +1033,7 @@ In order to activate auditing, add `@EnableJdbcAuditing` to your configuration,
10351033class Config {
10361034
10371035 @Bean
1038- public AuditorAware<AuditableUser> auditorProvider() {
1036+ AuditorAware<AuditableUser> auditorProvider() {
10391037 return new AuditorAwareImpl();
10401038 }
10411039}
0 commit comments