Polishing.
Remove superfluous public keyword where not required. Original pull request #980
This commit is contained in:
committed by
Jens Schauder
parent
b3a2925573
commit
f08b5cae6f
@@ -127,7 +127,7 @@ The Spring Data JDBC repositories support can be activated by an annotation thro
|
||||
class ApplicationConfig extends AbstractJdbcConfiguration { // <2>
|
||||
|
||||
@Bean
|
||||
public DataSource dataSource() { // <3>
|
||||
DataSource dataSource() { // <3>
|
||||
|
||||
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
|
||||
return builder.setType(EmbeddedDatabaseType.HSQL).build();
|
||||
@@ -250,13 +250,11 @@ Custom converters can be registered, for types that are not supported by default
|
||||
[source,java]
|
||||
----
|
||||
@Configuration
|
||||
public class DataJdbcConfiguration extends AbstractJdbcConfiguration {
|
||||
class DataJdbcConfiguration extends AbstractJdbcConfiguration {
|
||||
|
||||
@Override
|
||||
public JdbcCustomConversions jdbcCustomConversions() {
|
||||
|
||||
return new JdbcCustomConversions(Collections.singletonList(TimestampTzToDateConverter.INSTANCE));
|
||||
|
||||
}
|
||||
|
||||
@ReadingConverter
|
||||
@@ -303,7 +301,7 @@ The following example maps the `MyEntity` class to the `CUSTOM_TABLE_NAME` table
|
||||
[source,java]
|
||||
----
|
||||
@Table("CUSTOM_TABLE_NAME")
|
||||
public class MyEntity {
|
||||
class MyEntity {
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
@@ -322,7 +320,7 @@ The following example maps the `name` property of the `MyEntity` class to the `C
|
||||
====
|
||||
[source,java]
|
||||
----
|
||||
public class MyEntity {
|
||||
class MyEntity {
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
@@ -340,7 +338,7 @@ In the following example the corresponding table for the `MySubEntity` class has
|
||||
====
|
||||
[source,java]
|
||||
----
|
||||
public class MyEntity {
|
||||
class MyEntity {
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
@@ -348,7 +346,7 @@ public class MyEntity {
|
||||
Set<MySubEntity> subEntities;
|
||||
}
|
||||
|
||||
public class MySubEntity {
|
||||
class MySubEntity {
|
||||
String name;
|
||||
}
|
||||
----
|
||||
@@ -360,7 +358,7 @@ This additional column name may be customized with the `keyColumn` Element of th
|
||||
====
|
||||
[source,java]
|
||||
----
|
||||
public class MyEntity {
|
||||
class MyEntity {
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
@@ -368,7 +366,7 @@ public class MyEntity {
|
||||
List<MySubEntity> name;
|
||||
}
|
||||
|
||||
public class MySubEntity {
|
||||
class MySubEntity {
|
||||
String name;
|
||||
}
|
||||
----
|
||||
@@ -388,7 +386,7 @@ Opposite to this behavior `USE_EMPTY` tries to create a new instance using eithe
|
||||
====
|
||||
[source,java]
|
||||
----
|
||||
public class MyEntity {
|
||||
class MyEntity {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
@@ -397,7 +395,7 @@ public class MyEntity {
|
||||
EmbeddedEntity embeddedEntity;
|
||||
}
|
||||
|
||||
public class EmbeddedEntity {
|
||||
class EmbeddedEntity {
|
||||
String name;
|
||||
}
|
||||
----
|
||||
@@ -414,7 +412,7 @@ Make use of the shortcuts `@Embedded.Nullable` & `@Embedded.Empty` for `@Embedde
|
||||
|
||||
[source,java]
|
||||
----
|
||||
public class MyEntity {
|
||||
class MyEntity {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
@@ -610,7 +608,7 @@ The following example shows how to use `@Query` to declare a query method:
|
||||
====
|
||||
[source,java]
|
||||
----
|
||||
public interface UserRepository extends CrudRepository<User, Long> {
|
||||
interface UserRepository extends CrudRepository<User, Long> {
|
||||
|
||||
@Query("select firstName, lastName from User u where u.emailAddress = :email")
|
||||
User findByEmailAddress(@Param("email") String email);
|
||||
@@ -828,7 +826,7 @@ For example, the following listener gets invoked before an aggregate gets saved:
|
||||
[source,java]
|
||||
----
|
||||
@Bean
|
||||
public ApplicationListener<BeforeSaveEvent<Object>> loggingSaves() {
|
||||
ApplicationListener<BeforeSaveEvent<Object>> loggingSaves() {
|
||||
|
||||
return event -> {
|
||||
|
||||
@@ -845,7 +843,7 @@ Callback methods will only get invoked for events related to the domain type and
|
||||
====
|
||||
[source,java]
|
||||
----
|
||||
public class PersonLoadListener extends AbstractRelationalEventListener<Person> {
|
||||
class PersonLoadListener extends AbstractRelationalEventListener<Person> {
|
||||
|
||||
@Override
|
||||
protected void onAfterLoad(AfterLoadEvent<Person> personLoad) {
|
||||
@@ -937,11 +935,11 @@ If you need to tweak transaction configuration for one of the methods declared i
|
||||
====
|
||||
[source,java]
|
||||
----
|
||||
public interface UserRepository extends CrudRepository<User, Long> {
|
||||
interface UserRepository extends CrudRepository<User, Long> {
|
||||
|
||||
@Override
|
||||
@Transactional(timeout = 10)
|
||||
public List<User> findAll();
|
||||
List<User> findAll();
|
||||
|
||||
// Further query method declarations
|
||||
}
|
||||
@@ -959,7 +957,7 @@ The following example shows how to create such a facade:
|
||||
[source,java]
|
||||
----
|
||||
@Service
|
||||
class UserManagementImpl implements UserManagement {
|
||||
public class UserManagementImpl implements UserManagement {
|
||||
|
||||
private final UserRepository userRepository;
|
||||
private final RoleRepository roleRepository;
|
||||
@@ -999,7 +997,7 @@ To let your query methods be transactional, use `@Transactional` at the reposito
|
||||
[source,java]
|
||||
----
|
||||
@Transactional(readOnly = true)
|
||||
public interface UserRepository extends CrudRepository<User, Long> {
|
||||
interface UserRepository extends CrudRepository<User, Long> {
|
||||
|
||||
List<User> findByLastname(String lastname);
|
||||
|
||||
@@ -1035,7 +1033,7 @@ In order to activate auditing, add `@EnableJdbcAuditing` to your configuration,
|
||||
class Config {
|
||||
|
||||
@Bean
|
||||
public AuditorAware<AuditableUser> auditorProvider() {
|
||||
AuditorAware<AuditableUser> auditorProvider() {
|
||||
return new AuditorAwareImpl();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user