committed by
Mark Paluch
parent
24fa60a0bc
commit
6f0b7f6a0a
@@ -223,7 +223,7 @@ It's an established pattern to rather use static factory methods to expose these
|
||||
[[mapping.general-recommendations.override.properties]]
|
||||
=== Overriding Properties
|
||||
|
||||
Java's allows a flexible design of domain classes where a subclass could define a property that is already declared with the same name in its superclass.
|
||||
Java allows a flexible design of domain classes where a subclass could define a property that is already declared with the same name in its superclass.
|
||||
Consider the following example:
|
||||
|
||||
[source,java]
|
||||
@@ -326,7 +326,7 @@ data class Person(var id: String, val name: String) {
|
||||
----
|
||||
|
||||
Kotlin supports parameter optionality by allowing default values to be used if a parameter is not provided.
|
||||
When Spring Data detects a constructor with parameter defaulting, then it leaves these parameters absent if the data store does not provide a value (or simply returns `null`) so Kotlin can apply parameter defaulting.Consider the following class that applies parameter defaulting for `name`
|
||||
When Spring Data detects a constructor with parameter defaulting, then it leaves these parameters absent if the data store does not provide a value (or simply returns `null`) so Kotlin can apply parameter defaulting. Consider the following class that applies parameter defaulting for `name`
|
||||
|
||||
[source,kotlin]
|
||||
----
|
||||
|
||||
@@ -192,7 +192,7 @@ public class PropertyValueConverterRegistrar<P extends PersistentProperty<P>> {
|
||||
* Describes how to read a database value into a domain object's property value.
|
||||
*
|
||||
* @param reader must not be {@literal null}.
|
||||
* @return the confiured {@link PropertyValueConverterRegistrar}.
|
||||
* @return the configured {@link PropertyValueConverterRegistrar}.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public PropertyValueConverterRegistrar<P> reading(BiFunction<R, ValueConversionContext<P>, S> reader) {
|
||||
|
||||
@@ -117,7 +117,7 @@ class BeanWrapper<T> implements PersistentPropertyAccessor<T> {
|
||||
* @param property must not be {@literal null}.
|
||||
* @param type can be {@literal null}.
|
||||
* @return
|
||||
* @throws MappingException in case an exception occured when accessing the property.
|
||||
* @throws MappingException in case an exception occurred when accessing the property.
|
||||
*/
|
||||
@Nullable
|
||||
public <S> Object getProperty(PersistentProperty<?> property, Class<? extends S> type) {
|
||||
|
||||
@@ -102,7 +102,7 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
|
||||
|
||||
Assert.notNull(qualifiers, "Qualifiers must not be null");
|
||||
Assert.notNull(beanManager, "BeanManager must not be null");
|
||||
Assert.notNull(repositoryType, "Repoitory type must not be null");
|
||||
Assert.notNull(repositoryType, "Repository type must not be null");
|
||||
Assert.isTrue(repositoryType.isInterface(), "RepositoryType must be an interface");
|
||||
|
||||
this.qualifiers = qualifiers;
|
||||
@@ -127,7 +127,7 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
|
||||
|
||||
Assert.notNull(qualifiers, "Qualifiers must not be null");
|
||||
Assert.notNull(beanManager, "BeanManager must not be null");
|
||||
Assert.notNull(repositoryType, "Repoitory type must not be null");
|
||||
Assert.notNull(repositoryType, "Repository type must not be null");
|
||||
Assert.isTrue(repositoryType.isInterface(), "RepositoryType must be an interface");
|
||||
|
||||
this.qualifiers = qualifiers;
|
||||
|
||||
@@ -196,7 +196,7 @@ class RepositoryComponentProvider extends ClassPathScanningCandidateComponentPro
|
||||
*/
|
||||
private AllTypeFilter {
|
||||
|
||||
Assert.notNull(delegates, "TypeFilter deleages must not be null");
|
||||
Assert.notNull(delegates, "TypeFilter delegates must not be null");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.springframework.util.ClassUtils;
|
||||
*/
|
||||
public class AnnotatedTypeScanner implements ResourceLoaderAware, EnvironmentAware {
|
||||
|
||||
private final Iterable<Class<? extends Annotation>> annotationTypess;
|
||||
private final Iterable<Class<? extends Annotation>> annotationTypes;
|
||||
private final boolean considerInterfaces;
|
||||
|
||||
private @Nullable ResourceLoader resourceLoader;
|
||||
@@ -83,7 +83,7 @@ public class AnnotatedTypeScanner implements ResourceLoaderAware, EnvironmentAwa
|
||||
public AnnotatedTypeScanner(boolean considerInterfaces, Collection<Class<? extends Annotation>> annotationTypes) {
|
||||
|
||||
this.considerInterfaces = considerInterfaces;
|
||||
this.annotationTypess = annotationTypes;
|
||||
this.annotationTypes = annotationTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,7 +146,7 @@ public class AnnotatedTypeScanner implements ResourceLoaderAware, EnvironmentAwa
|
||||
}
|
||||
|
||||
public Set<Class<?>> findTypes(Iterable<String> basePackages) {
|
||||
return findTypes(basePackages, Streamable.of(annotationTypess).stream().map(annotation -> new AnnotationTypeFilter(annotation, true, considerInterfaces)).collect(Collectors.toSet()));
|
||||
return findTypes(basePackages, Streamable.of(annotationTypes).stream().map(annotation -> new AnnotationTypeFilter(annotation, true, considerInterfaces)).collect(Collectors.toSet()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user