@@ -94,10 +94,6 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ
|
||||
.orElse(Auditor.none());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
|
||||
*/
|
||||
public void afterPropertiesSet() {
|
||||
|
||||
if (!auditorAware.isPresent()) {
|
||||
|
||||
@@ -30,10 +30,6 @@ public enum CurrentDateTimeProvider implements DateTimeProvider {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.DateTimeProvider#getNow()
|
||||
*/
|
||||
@Override
|
||||
public Optional<TemporalAccessor> getNow() {
|
||||
return Optional.of(LocalDateTime.now());
|
||||
|
||||
@@ -106,10 +106,6 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
|
||||
.getGeneric(2).resolve(TemporalAccessor.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setCreatedBy(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public Object setCreatedBy(Object value) {
|
||||
|
||||
@@ -117,10 +113,6 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setCreatedDate(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public TemporalAccessor setCreatedDate(TemporalAccessor value) {
|
||||
|
||||
@@ -129,10 +121,6 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.DefaultAuditableBeanWrapperFactory.AuditableInterfaceBeanWrapper#setLastModifiedBy(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public Object setLastModifiedBy(Object value) {
|
||||
|
||||
@@ -141,19 +129,11 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#getLastModifiedDate()
|
||||
*/
|
||||
@Override
|
||||
public Optional<TemporalAccessor> getLastModifiedDate() {
|
||||
return getAsTemporalAccessor(auditable.getLastModifiedDate(), TemporalAccessor.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setLastModifiedDate(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public TemporalAccessor setLastModifiedDate(TemporalAccessor value) {
|
||||
|
||||
@@ -163,10 +143,6 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#getBean()
|
||||
*/
|
||||
@Override
|
||||
public Auditable<Object, ?, TemporalAccessor> getBean() {
|
||||
return auditable;
|
||||
@@ -280,38 +256,22 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setCreatedBy(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public Object setCreatedBy(Object value) {
|
||||
return setField(metadata.getCreatedByField(), value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setCreatedDate(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public TemporalAccessor setCreatedDate(TemporalAccessor value) {
|
||||
|
||||
return setDateField(metadata.getCreatedDateField(), value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setLastModifiedBy(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public Object setLastModifiedBy(Object value) {
|
||||
return setField(metadata.getLastModifiedByField(), value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#getLastModifiedDate()
|
||||
*/
|
||||
@Override
|
||||
public Optional<TemporalAccessor> getLastModifiedDate() {
|
||||
|
||||
@@ -323,19 +283,11 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
|
||||
}), TemporalAccessor.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setLastModifiedDate(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public TemporalAccessor setLastModifiedDate(TemporalAccessor value) {
|
||||
return setDateField(metadata.getLastModifiedDateField(), value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#getBean()
|
||||
*/
|
||||
@Override
|
||||
public T getBean() {
|
||||
return target;
|
||||
|
||||
@@ -70,10 +70,6 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap
|
||||
this.metadataCache = new ConcurrentReferenceHashMap<>();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapperFactory#getBeanWrapperFor(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> Optional<AuditableBeanWrapper<T>> getBeanWrapperFor(T source) {
|
||||
|
||||
@@ -195,37 +191,21 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setCreatedBy(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object setCreatedBy(Object value) {
|
||||
return setProperty(metadata.createdByPaths, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setCreatedDate(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public TemporalAccessor setCreatedDate(TemporalAccessor value) {
|
||||
return setDateProperty(metadata.createdDatePaths, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setLastModifiedBy(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public Object setLastModifiedBy(Object value) {
|
||||
return setProperty(metadata.lastModifiedByPaths, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#getLastModifiedDate()
|
||||
*/
|
||||
@Override
|
||||
public Optional<TemporalAccessor> getLastModifiedDate() {
|
||||
|
||||
@@ -235,19 +215,11 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap
|
||||
return getAsTemporalAccessor(firstValue, TemporalAccessor.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#setLastModifiedDate(java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public TemporalAccessor setLastModifiedDate(TemporalAccessor value) {
|
||||
return setDateProperty(metadata.lastModifiedDatePaths, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.AuditableBeanWrapper#getBean()
|
||||
*/
|
||||
@Override
|
||||
public T getBean() {
|
||||
return accessor.getBean();
|
||||
|
||||
@@ -55,37 +55,21 @@ public class AnnotationAuditingConfiguration implements AuditingConfiguration {
|
||||
this.attributes = new AnnotationAttributes(attributesSource);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.config.AuditingConfiguration#getAuditorAwareRef()
|
||||
*/
|
||||
@Override
|
||||
public String getAuditorAwareRef() {
|
||||
return attributes.getString("auditorAwareRef");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.config.AuditingConfiguration#isSetDates()
|
||||
*/
|
||||
@Override
|
||||
public boolean isSetDates() {
|
||||
return attributes.getBoolean("setDates");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.config.AuditingConfiguration#getDateTimeProviderRef()
|
||||
*/
|
||||
@Override
|
||||
public String getDateTimeProviderRef() {
|
||||
return attributes.getString("dateTimeProviderRef");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.auditing.config.AuditingConfiguration#isModifyOnCreate()
|
||||
*/
|
||||
@Override
|
||||
public boolean isModifyOnCreate() {
|
||||
return attributes.getBoolean("modifyOnCreate");
|
||||
|
||||
@@ -50,10 +50,6 @@ public abstract class AuditingBeanDefinitionRegistrarSupport implements ImportBe
|
||||
private static final String MODIFY_ON_CREATE = "modifyOnCreation";
|
||||
private static final String SET_DATES = "dateTimeForNow";
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.annotation.ImportBeanDefinitionRegistrar#registerBeanDefinitions(org.springframework.core.type.AnnotationMetadata, org.springframework.beans.factory.support.BeanDefinitionRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {
|
||||
|
||||
|
||||
@@ -69,29 +69,17 @@ public class AuditingHandlerBeanDefinitionParser extends AbstractSingleBeanDefin
|
||||
return resolvedBeanName;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser#getBeanClass(org.w3c.dom.Element)
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
protected Class<?> getBeanClass(Element element) {
|
||||
return AuditingHandler.class;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.xml.AbstractBeanDefinitionParser#shouldGenerateId()
|
||||
*/
|
||||
@Override
|
||||
protected boolean shouldGenerateId() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser#doParse(org.w3c.dom.Element, org.springframework.beans.factory.support.BeanDefinitionBuilder)
|
||||
*/
|
||||
@Override
|
||||
protected void doParse(Element element, BeanDefinitionBuilder builder) {
|
||||
|
||||
@@ -110,10 +98,6 @@ public class AuditingHandlerBeanDefinitionParser extends AbstractSingleBeanDefin
|
||||
ParsingUtils.setPropertyValue(builder, element, "modify-on-creation", "modifyOnCreation");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.xml.AbstractBeanDefinitionParser#resolveId(org.w3c.dom.Element, org.springframework.beans.factory.support.AbstractBeanDefinition, org.springframework.beans.factory.xml.ParserContext)
|
||||
*/
|
||||
@Override
|
||||
protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) {
|
||||
|
||||
|
||||
@@ -37,10 +37,6 @@ public class IsNewAwareAuditingHandlerBeanDefinitionParser extends AuditingHandl
|
||||
super(mappingContextBeanName);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.config.AuditingHandlerBeanDefinitionParser#getBeanClass(org.w3c.dom.Element)
|
||||
*/
|
||||
@Override
|
||||
protected Class<?> getBeanClass(Element element) {
|
||||
return IsNewAwareAuditingHandler.class;
|
||||
|
||||
@@ -66,18 +66,10 @@ public class ConfigurableTypeInformationMapper implements TypeInformationMapper
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.TypeInformationMapper#createAliasFor(org.springframework.data.util.TypeInformation)
|
||||
*/
|
||||
public Alias createAliasFor(TypeInformation<?> type) {
|
||||
return typeToAlias.getOrDefault(type, Alias.NONE);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.TypeInformationMapper#resolveTypeFrom(org.springframework.data.mapping.Alias)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public TypeInformation<?> resolveTypeFrom(Alias alias) {
|
||||
|
||||
@@ -827,10 +827,6 @@ public class CustomConversions {
|
||||
return this.storeConverters;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -849,10 +845,6 @@ public class CustomConversions {
|
||||
return ObjectUtils.nullSafeEquals(storeConverters, that.storeConverters);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(storeTypeHolder);
|
||||
@@ -860,10 +852,6 @@ public class CustomConversions {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreConversions{" + "storeTypeHolder=" + storeTypeHolder + ", storeConverters=" + storeConverters + '}';
|
||||
|
||||
@@ -48,48 +48,28 @@ record DefaultConverterBuilder<S, T> (ConvertiblePair convertiblePair,
|
||||
Optional<Function<? super S, ? extends T>> writing, Optional<Function<? super T, ? extends S>> reading)
|
||||
implements ConverterAware, ReadingConverterBuilder<T, S>, WritingConverterBuilder<S, T> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.WritingConverterBuilder#andReading(java.util.function.Function)
|
||||
*/
|
||||
@Override
|
||||
public ConverterAware andReading(Function<? super T, ? extends S> function) {
|
||||
return withReading(Optional.of(function));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.ReadingConverterBuilder#andWriting(java.util.function.Function)
|
||||
*/
|
||||
@Override
|
||||
public ConverterAware andWriting(Function<? super S, ? extends T> function) {
|
||||
return withWriting(Optional.of(function));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.ReadingConverterBuilder#getRequiredReadingConverter()
|
||||
*/
|
||||
@Override
|
||||
public GenericConverter getReadingConverter() {
|
||||
return getOptionalReadingConverter()
|
||||
.orElseThrow(() -> new IllegalStateException("No reading converter specified!"));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.WritingConverterBuilder#getRequiredWritingConverter()
|
||||
*/
|
||||
@Override
|
||||
public GenericConverter getWritingConverter() {
|
||||
return getOptionalWritingConverter()
|
||||
.orElseThrow(() -> new IllegalStateException("No writing converter specified!"));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.ConverterBuilder#getConverters()
|
||||
*/
|
||||
@Override
|
||||
public Set<GenericConverter> getConverters() {
|
||||
|
||||
@@ -130,10 +110,6 @@ record DefaultConverterBuilder<S, T> (ConvertiblePair convertiblePair,
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.GenericConverter#convert(java.lang.Object, org.springframework.core.convert.TypeDescriptor, org.springframework.core.convert.TypeDescriptor)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -141,20 +117,11 @@ record DefaultConverterBuilder<S, T> (ConvertiblePair convertiblePair,
|
||||
return function.apply((S) source);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.GenericConverter#getConvertibleTypes()
|
||||
*/
|
||||
|
||||
@Override
|
||||
public Set<ConvertiblePair> getConvertibleTypes() {
|
||||
return Collections.singleton(convertiblePair);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -173,10 +140,6 @@ record DefaultConverterBuilder<S, T> (ConvertiblePair convertiblePair,
|
||||
return ObjectUtils.nullSafeEquals(function, that.function);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(convertiblePair);
|
||||
|
||||
@@ -107,10 +107,6 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.TypeMapper#readType(java.lang.Object)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public TypeInformation<?> readType(S source) {
|
||||
@@ -139,10 +135,6 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
|
||||
return typeInformation.orElse(null);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.TypeMapper#readType(java.lang.Object, org.springframework.data.util.TypeInformation)
|
||||
*/
|
||||
@Override
|
||||
public <T> TypeInformation<? extends T> readType(S source, TypeInformation<T> basicType) {
|
||||
|
||||
@@ -196,19 +188,11 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.TypeMapper#writeType(java.lang.Class, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void writeType(Class<?> type, S dbObject) {
|
||||
writeType(ClassTypeInformation.from(type), dbObject);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.TypeMapper#writeType(org.springframework.data.util.TypeInformation, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void writeType(TypeInformation<?> info, S sink) {
|
||||
|
||||
@@ -220,10 +204,6 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.BeanClassLoaderAware#setBeanClassLoader(java.lang.ClassLoader)
|
||||
*/
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
for (TypeInformationMapper mapper : mappers) {
|
||||
|
||||
@@ -283,10 +283,6 @@ public abstract class Jsr310Converters {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
public LocalDate convert(String source) {
|
||||
@@ -299,10 +295,6 @@ public abstract class Jsr310Converters {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
public LocalDateTime convert(String source) {
|
||||
@@ -315,10 +307,6 @@ public abstract class Jsr310Converters {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
public Instant convert(String source) {
|
||||
|
||||
@@ -57,10 +57,6 @@ public class MappingContextTypeInformationMapper implements TypeInformationMappe
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.TypeInformationMapper#createAliasFor(org.springframework.data.util.TypeInformation)
|
||||
*/
|
||||
public Alias createAliasFor(TypeInformation<?> type) {
|
||||
|
||||
return typeMap.computeIfAbsent(type.getRawTypeInformation(), key -> {
|
||||
@@ -111,10 +107,6 @@ public class MappingContextTypeInformationMapper implements TypeInformationMappe
|
||||
return alias;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.convert.TypeInformationMapper#resolveTypeFrom(java.util.Optional)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public TypeInformation<?> resolveTypeFrom(Alias alias) {
|
||||
|
||||
@@ -74,10 +74,6 @@ public class SimpleTypeInformationMapper implements TypeInformationMapper, BeanC
|
||||
return Alias.of(type.getType().getName());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.BeanClassLoaderAware#setBeanClassLoader(java.lang.ClassLoader)
|
||||
*/
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
this.classLoader = classLoader;
|
||||
|
||||
@@ -52,50 +52,26 @@ public abstract class AbstractPageRequest implements Pageable, Serializable {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#getPageSize()
|
||||
*/
|
||||
public int getPageSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#getPageNumber()
|
||||
*/
|
||||
public int getPageNumber() {
|
||||
return page;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#getOffset()
|
||||
*/
|
||||
public long getOffset() {
|
||||
return (long) page * (long) size;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#hasPrevious()
|
||||
*/
|
||||
public boolean hasPrevious() {
|
||||
return page > 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#previousOrFirst()
|
||||
*/
|
||||
public Pageable previousOrFirst() {
|
||||
return hasPrevious() ? previous() : first();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#next()
|
||||
*/
|
||||
public abstract Pageable next();
|
||||
|
||||
/**
|
||||
@@ -105,16 +81,8 @@ public abstract class AbstractPageRequest implements Pageable, Serializable {
|
||||
*/
|
||||
public abstract Pageable previous();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#first()
|
||||
*/
|
||||
public abstract Pageable first();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
@@ -127,10 +95,6 @@ public abstract class AbstractPageRequest implements Pageable, Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
|
||||
@@ -54,108 +54,56 @@ abstract class Chunk<T> implements Slice<T>, Serializable {
|
||||
this.pageable = pageable;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#getNumber()
|
||||
*/
|
||||
public int getNumber() {
|
||||
return pageable.isPaged() ? pageable.getPageNumber() : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#getSize()
|
||||
*/
|
||||
public int getSize() {
|
||||
return pageable.isPaged() ? pageable.getPageSize() : content.size();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#getNumberOfElements()
|
||||
*/
|
||||
public int getNumberOfElements() {
|
||||
return content.size();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#hasPrevious()
|
||||
*/
|
||||
public boolean hasPrevious() {
|
||||
return getNumber() > 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#isFirst()
|
||||
*/
|
||||
public boolean isFirst() {
|
||||
return !hasPrevious();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#isLast()
|
||||
*/
|
||||
public boolean isLast() {
|
||||
return !hasNext();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#nextPageable()
|
||||
*/
|
||||
public Pageable nextPageable() {
|
||||
return hasNext() ? pageable.next() : Pageable.unpaged();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#previousPageable()
|
||||
*/
|
||||
public Pageable previousPageable() {
|
||||
return hasPrevious() ? pageable.previousOrFirst() : Pageable.unpaged();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#hasContent()
|
||||
*/
|
||||
public boolean hasContent() {
|
||||
return !content.isEmpty();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#getContent()
|
||||
*/
|
||||
public List<T> getContent() {
|
||||
return Collections.unmodifiableList(content);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#getPageable()
|
||||
*/
|
||||
@Override
|
||||
public Pageable getPageable() {
|
||||
return pageable;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#getSort()
|
||||
*/
|
||||
@Override
|
||||
public Sort getSort() {
|
||||
return pageable.getSort();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
public Iterator<T> iterator() {
|
||||
return content.iterator();
|
||||
}
|
||||
@@ -173,10 +121,6 @@ abstract class Chunk<T> implements Slice<T>, Serializable {
|
||||
return this.stream().map(converter::apply).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
@@ -194,10 +138,6 @@ abstract class Chunk<T> implements Slice<T>, Serializable {
|
||||
return contentEqual && pageableEqual;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
|
||||
@@ -440,10 +440,6 @@ public interface ExampleMatcher {
|
||||
return other instanceof GenericPropertyMatcher;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -465,10 +461,6 @@ public interface ExampleMatcher {
|
||||
return ObjectUtils.nullSafeEquals(valueTransformer, that.valueTransformer);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(stringMatcher);
|
||||
@@ -607,10 +599,6 @@ public interface ExampleMatcher {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.util.function.Function#apply(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("null")
|
||||
public Optional<Object> apply(Optional<Object> source) {
|
||||
@@ -738,10 +726,6 @@ public interface ExampleMatcher {
|
||||
return getPropertyValueTransformer().apply(source);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -767,10 +751,6 @@ public interface ExampleMatcher {
|
||||
return ObjectUtils.nullSafeEquals(valueTransformer, that.valueTransformer);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(path);
|
||||
@@ -825,10 +805,6 @@ public interface ExampleMatcher {
|
||||
return propertySpecifiers.values();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -843,10 +819,6 @@ public interface ExampleMatcher {
|
||||
return ObjectUtils.nullSafeEquals(propertySpecifiers, that.propertySpecifiers);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ObjectUtils.nullSafeHashCode(propertySpecifiers);
|
||||
|
||||
@@ -61,55 +61,31 @@ public class PageImpl<T> extends Chunk<T> implements Page<T> {
|
||||
this(content, Pageable.unpaged(), null == content ? 0 : content.size());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Page#getTotalPages()
|
||||
*/
|
||||
@Override
|
||||
public int getTotalPages() {
|
||||
return getSize() == 0 ? 1 : (int) Math.ceil((double) total / (double) getSize());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Page#getTotalElements()
|
||||
*/
|
||||
@Override
|
||||
public long getTotalElements() {
|
||||
return total;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#hasNext()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return getNumber() + 1 < getTotalPages();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#isLast()
|
||||
*/
|
||||
@Override
|
||||
public boolean isLast() {
|
||||
return !hasNext();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#transform(org.springframework.core.convert.converter.Converter)
|
||||
*/
|
||||
@Override
|
||||
public <U> Page<U> map(Function<? super T, ? extends U> converter) {
|
||||
return new PageImpl<>(getConvertedContent(converter), getPageable(), total);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@@ -123,10 +99,6 @@ public class PageImpl<T> extends Chunk<T> implements Page<T> {
|
||||
return String.format("Page %s of %d containing %s instances", getNumber() + 1, getTotalPages(), contentType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -141,10 +113,6 @@ public class PageImpl<T> extends Chunk<T> implements Page<T> {
|
||||
return this.total == that.total && super.equals(obj);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
|
||||
@@ -96,45 +96,25 @@ public class PageRequest extends AbstractPageRequest {
|
||||
return PageRequest.of(0, pageSize);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#getSort()
|
||||
*/
|
||||
public Sort getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#next()
|
||||
*/
|
||||
@Override
|
||||
public PageRequest next() {
|
||||
return new PageRequest(getPageNumber() + 1, getPageSize(), getSort());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.AbstractPageRequest#previous()
|
||||
*/
|
||||
@Override
|
||||
public PageRequest previous() {
|
||||
return getPageNumber() == 0 ? this : new PageRequest(getPageNumber() - 1, getPageSize(), getSort());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#first()
|
||||
*/
|
||||
@Override
|
||||
public PageRequest first() {
|
||||
return new PageRequest(0, getPageSize(), getSort());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -184,19 +164,11 @@ public class PageRequest extends AbstractPageRequest {
|
||||
return new PageRequest(getPageNumber(), getPageSize(), sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 31 * super.hashCode() + sort.hashCode();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Page request [number: %d, size %d, sort: %s]", getPageNumber(), getPageSize(), sort);
|
||||
|
||||
@@ -198,10 +198,6 @@ public final class Range<T extends Comparable<T>> {
|
||||
return greaterThanLowerBound && lessThanUpperBound;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s-%s", lowerBound.toPrefixString(), upperBound.toSuffixString());
|
||||
@@ -215,10 +211,6 @@ public final class Range<T extends Comparable<T>> {
|
||||
return this.upperBound;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -237,10 +229,6 @@ public final class Range<T extends Comparable<T>> {
|
||||
return ObjectUtils.nullSafeEquals(upperBound, range.upperBound);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(lowerBound);
|
||||
@@ -406,10 +394,6 @@ public final class Range<T extends Comparable<T>> {
|
||||
.orElse("unbounded");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return value.map(Object::toString).orElse("unbounded");
|
||||
@@ -423,10 +407,6 @@ public final class Range<T extends Comparable<T>> {
|
||||
return this.inclusive;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -444,10 +424,6 @@ public final class Range<T extends Comparable<T>> {
|
||||
return ObjectUtils.nullSafeEquals(value, bound.value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(value);
|
||||
|
||||
@@ -59,27 +59,15 @@ public class SliceImpl<T> extends Chunk<T> {
|
||||
this(content, Pageable.unpaged(), false);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#hasNext()
|
||||
*/
|
||||
public boolean hasNext() {
|
||||
return hasNext;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Slice#transform(org.springframework.core.convert.converter.Converter)
|
||||
*/
|
||||
@Override
|
||||
public <U> Slice<U> map(Function<? super T, ? extends U> converter) {
|
||||
return new SliceImpl<>(getConvertedContent(converter), pageable, hasNext);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@@ -93,10 +81,6 @@ public class SliceImpl<T> extends Chunk<T> {
|
||||
return String.format("Slice %d containing %s instances", getNumber(), contentType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -111,10 +95,6 @@ public class SliceImpl<T> extends Chunk<T> {
|
||||
return this.hasNext == that.hasNext && super.equals(obj);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
|
||||
@@ -220,18 +220,10 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
public Iterator<Order> iterator() {
|
||||
return this.orders.iterator();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -246,10 +238,6 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
return toList().equals(that.toList());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
@@ -258,10 +246,6 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return isEmpty() ? "UNSORTED" : StringUtils.collectionToCommaDelimitedString(orders);
|
||||
@@ -598,10 +582,6 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
return nullHandling;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
@@ -615,10 +595,6 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -634,10 +610,6 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
&& this.ignoreCase == that.ignoreCase && this.nullHandling.equals(that.nullHandling);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@@ -708,10 +680,6 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
.orElseGet(Sort::unsorted);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Sort#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<Order> iterator() {
|
||||
|
||||
@@ -726,10 +694,6 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
|
||||
return !recorded.getPropertyPath().isPresent();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Sort#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
|
||||
@@ -46,10 +46,6 @@ class TypedExample<T> implements Example<T> {
|
||||
return this.matcher;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -68,10 +64,6 @@ class TypedExample<T> implements Example<T> {
|
||||
return ObjectUtils.nullSafeEquals(matcher, that.matcher);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(probe);
|
||||
@@ -79,10 +71,6 @@ class TypedExample<T> implements Example<T> {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TypedExample{" + "probe=" + probe + ", matcher=" + matcher + '}';
|
||||
|
||||
@@ -55,10 +55,6 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#withIgnorePaths(java.lang.String...)
|
||||
*/
|
||||
@Override
|
||||
public ExampleMatcher withIgnorePaths(String... ignoredPaths) {
|
||||
|
||||
@@ -72,10 +68,6 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
defaultIgnoreCase, mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#withStringMatcher(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public ExampleMatcher withStringMatcher(StringMatcher defaultStringMatcher) {
|
||||
|
||||
@@ -85,20 +77,12 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
defaultIgnoreCase, mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#withIgnoreCase(boolean)
|
||||
*/
|
||||
@Override
|
||||
public ExampleMatcher withIgnoreCase(boolean defaultIgnoreCase) {
|
||||
return new TypedExampleMatcher(nullHandler, defaultStringMatcher, propertySpecifiers, ignoredPaths,
|
||||
defaultIgnoreCase, mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#withMatcher(java.lang.String, org.springframework.data.domain.ExampleMatcher.MatcherConfigurer)
|
||||
*/
|
||||
@Override
|
||||
public ExampleMatcher withMatcher(String propertyPath, GenericPropertyMatcher genericPropertyMatcher) {
|
||||
|
||||
@@ -124,10 +108,6 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
defaultIgnoreCase, mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#withTransformer(java.lang.String, org.springframework.data.domain.ExampleMatcher.PropertyValueTransformer)
|
||||
*/
|
||||
@Override
|
||||
public ExampleMatcher withTransformer(String propertyPath, PropertyValueTransformer propertyValueTransformer) {
|
||||
|
||||
@@ -143,10 +123,6 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
defaultIgnoreCase, mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#withIgnoreCase(java.lang.String...)
|
||||
*/
|
||||
@Override
|
||||
public ExampleMatcher withIgnoreCase(String... propertyPaths) {
|
||||
|
||||
@@ -164,10 +140,6 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
defaultIgnoreCase, mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#withNullHandler(org.springframework.data.domain.ExampleMatcher.NullHandler)
|
||||
*/
|
||||
@Override
|
||||
public ExampleMatcher withNullHandler(NullHandler nullHandler) {
|
||||
|
||||
@@ -176,55 +148,31 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
defaultIgnoreCase, mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#getNullHandler()
|
||||
*/
|
||||
@Override
|
||||
public NullHandler getNullHandler() {
|
||||
return nullHandler;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#getDefaultStringMatcher()
|
||||
*/
|
||||
@Override
|
||||
public StringMatcher getDefaultStringMatcher() {
|
||||
return defaultStringMatcher;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#isIgnoreCaseEnabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isIgnoreCaseEnabled() {
|
||||
return this.defaultIgnoreCase;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#getIgnoredPaths()
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getIgnoredPaths() {
|
||||
return ignoredPaths;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#getPropertySpecifiers()
|
||||
*/
|
||||
@Override
|
||||
public PropertySpecifiers getPropertySpecifiers() {
|
||||
return propertySpecifiers;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.ExampleMatcher#getMatchMode()
|
||||
*/
|
||||
@Override
|
||||
public MatchMode getMatchMode() {
|
||||
return mode;
|
||||
@@ -245,10 +193,6 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
return new PropertySpecifier(propertyPath);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -284,10 +228,6 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
return mode == that.mode;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(nullHandler);
|
||||
@@ -299,10 +239,6 @@ class TypedExampleMatcher implements ExampleMatcher {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TypedExampleMatcher{" + "nullHandler=" + nullHandler + ", defaultStringMatcher=" + defaultStringMatcher
|
||||
|
||||
@@ -24,91 +24,51 @@ enum Unpaged implements Pageable {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#isPaged()
|
||||
*/
|
||||
@Override
|
||||
public boolean isPaged() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#previousOrFirst()
|
||||
*/
|
||||
@Override
|
||||
public Pageable previousOrFirst() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#next()
|
||||
*/
|
||||
@Override
|
||||
public Pageable next() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#hasPrevious()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasPrevious() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#getSort()
|
||||
*/
|
||||
@Override
|
||||
public Sort getSort() {
|
||||
return Sort.unsorted();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#getPageSize()
|
||||
*/
|
||||
@Override
|
||||
public int getPageSize() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#getPageNumber()
|
||||
*/
|
||||
@Override
|
||||
public int getPageNumber() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#getOffset()
|
||||
*/
|
||||
@Override
|
||||
public long getOffset() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#first()
|
||||
*/
|
||||
@Override
|
||||
public Pageable first() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#withPage(int)
|
||||
*/
|
||||
@Override
|
||||
public Pageable withPage(int pageNumber) {
|
||||
|
||||
|
||||
@@ -30,10 +30,6 @@ public class OrderAdapter extends XmlAdapter<OrderDto, Order> {
|
||||
|
||||
public static final OrderAdapter INSTANCE = new OrderAdapter();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public OrderDto marshal(@Nullable Order order) {
|
||||
@@ -48,10 +44,6 @@ public class OrderAdapter extends XmlAdapter<OrderDto, Order> {
|
||||
return dto;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Order unmarshal(@Nullable OrderDto source) {
|
||||
|
||||
@@ -32,10 +32,6 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
public class PageAdapter extends XmlAdapter<PageDto, Page<Object>> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public PageDto marshal(@Nullable Page<Object> source) {
|
||||
@@ -51,10 +47,6 @@ public class PageAdapter extends XmlAdapter<PageDto, Page<Object>> {
|
||||
return dto;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Page<Object> unmarshal(@Nullable PageDto v) {
|
||||
|
||||
@@ -34,10 +34,6 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
class PageableAdapter extends XmlAdapter<PageRequestDto, Pageable> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public PageRequestDto marshal(@Nullable Pageable request) {
|
||||
@@ -56,10 +52,6 @@ class PageableAdapter extends XmlAdapter<PageRequestDto, Pageable> {
|
||||
return dto;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
public Pageable unmarshal(@Nullable PageRequestDto v) {
|
||||
|
||||
@@ -31,10 +31,6 @@ public class SortAdapter extends XmlAdapter<SortDto, Sort> {
|
||||
|
||||
public static final SortAdapter INSTANCE = new SortAdapter();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public SortDto marshal(@Nullable Sort source) {
|
||||
@@ -49,10 +45,6 @@ public class SortAdapter extends XmlAdapter<SortDto, Sort> {
|
||||
return dto;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
public Sort unmarshal(@Nullable SortDto source) {
|
||||
|
||||
@@ -81,19 +81,11 @@ public class Box implements Shape {
|
||||
return second;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Box [%s, %s]", first, second);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
@@ -105,10 +97,6 @@ public class Box implements Shape {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
|
||||
@@ -91,10 +91,6 @@ public class Circle implements Shape {
|
||||
return radius;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -113,10 +109,6 @@ public class Circle implements Shape {
|
||||
return ObjectUtils.nullSafeEquals(radius, circle.radius);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(center);
|
||||
@@ -124,10 +116,6 @@ public class Circle implements Shape {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Circle: [center=%s, radius=%s]", center, radius);
|
||||
|
||||
@@ -55,18 +55,10 @@ public class CustomMetric implements Metric {
|
||||
this.abbreviation = abbreviation;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.geo.Metric#getMultiplier()
|
||||
*/
|
||||
public double getMultiplier() {
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.geo.Metric#getAbbreviation()
|
||||
*/
|
||||
@Override
|
||||
public String getAbbreviation() {
|
||||
return abbreviation;
|
||||
|
||||
@@ -158,10 +158,6 @@ public final class Distance implements Serializable, Comparable<Distance> {
|
||||
return this.metric.equals(metric) ? this : new Distance(getNormalizedValue() * metric.getMultiplier(), metric);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(@Nullable Distance that) {
|
||||
|
||||
@@ -174,10 +170,6 @@ public final class Distance implements Serializable, Comparable<Distance> {
|
||||
return difference == 0 ? 0 : difference > 0 ? 1 : -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@@ -199,10 +191,6 @@ public final class Distance implements Serializable, Comparable<Distance> {
|
||||
return this.metric;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -220,10 +208,6 @@ public final class Distance implements Serializable, Comparable<Distance> {
|
||||
return ObjectUtils.nullSafeEquals(metric, distance.metric);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result;
|
||||
|
||||
@@ -64,10 +64,6 @@ public class GeoPage<T> extends PageImpl<GeoResult<T>> {
|
||||
this.averageDistance = results.getAverageDistance();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.PageImpl#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -82,10 +78,6 @@ public class GeoPage<T> extends PageImpl<GeoResult<T>> {
|
||||
return super.equals(obj) && ObjectUtils.nullSafeEquals(this.averageDistance, that.averageDistance);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.PageImpl#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode() + ObjectUtils.nullSafeHashCode(this.averageDistance);
|
||||
|
||||
@@ -51,10 +51,6 @@ public final class GeoResult<T> implements Serializable {
|
||||
return this.distance;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -73,10 +69,6 @@ public final class GeoResult<T> implements Serializable {
|
||||
return ObjectUtils.nullSafeEquals(distance, geoResult.distance);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(content);
|
||||
@@ -84,10 +76,6 @@ public final class GeoResult<T> implements Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("GeoResult [content: %s, distance: %s, ]", content.toString(), distance.toString());
|
||||
|
||||
@@ -95,19 +95,11 @@ public class GeoResults<T> implements Iterable<GeoResult<T>>, Serializable {
|
||||
return Collections.unmodifiableList(results);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Iterator<GeoResult<T>> iterator() {
|
||||
return (Iterator<GeoResult<T>>) results.iterator();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -126,10 +118,6 @@ public class GeoResults<T> implements Iterable<GeoResult<T>>, Serializable {
|
||||
return ObjectUtils.nullSafeEquals(averageDistance, that.averageDistance);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(results);
|
||||
@@ -137,10 +125,6 @@ public class GeoResults<T> implements Iterable<GeoResult<T>>, Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("GeoResults: [averageDistance: %s, results: %s]", averageDistance.toString(),
|
||||
|
||||
@@ -41,18 +41,10 @@ public enum Metrics implements Metric {
|
||||
this.abbreviation = abbreviation;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.geo.Metric#getMultiplier()
|
||||
*/
|
||||
public double getMultiplier() {
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.geo.Metric#getAbbreviation()
|
||||
*/
|
||||
@Override
|
||||
public String getAbbreviation() {
|
||||
return abbreviation;
|
||||
|
||||
@@ -80,10 +80,6 @@ public class Point implements Serializable {
|
||||
return y;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
@@ -98,10 +94,6 @@ public class Point implements Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -124,10 +116,6 @@ public class Point implements Serializable {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(Locale.ENGLISH, "Point [x=%f, y=%f]", x, y);
|
||||
|
||||
@@ -92,18 +92,10 @@ public class Polygon implements Iterable<Point>, Shape {
|
||||
return this.points;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
public Iterator<Point> iterator() {
|
||||
return this.points.iterator();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -118,19 +110,11 @@ public class Polygon implements Iterable<Point>, Shape {
|
||||
return ObjectUtils.nullSafeEquals(points, that.points);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ObjectUtils.nullSafeHashCode(points);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Polygon: [%s]", StringUtils.collectionToCommaDelimitedString(points));
|
||||
|
||||
@@ -57,29 +57,17 @@ public enum DistanceFormatter implements Converter<String, Distance>, Formatter<
|
||||
SUPPORTED_METRICS = Collections.unmodifiableMap(metrics);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public final Distance convert(String source) {
|
||||
return source == null ? null : doConvert(source.trim().toLowerCase(Locale.US));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.format.Printer#print(java.lang.Object, java.util.Locale)
|
||||
*/
|
||||
@Override
|
||||
public String print(Distance distance, Locale locale) {
|
||||
return distance == null ? null : String.format("%s%s", distance.getValue(), distance.getUnit().toLowerCase(locale));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.format.Parser#parse(java.lang.String, java.util.Locale)
|
||||
*/
|
||||
@Override
|
||||
public Distance parse(String text, Locale locale) throws ParseException {
|
||||
return doConvert(text.trim().toLowerCase(locale));
|
||||
|
||||
@@ -37,10 +37,6 @@ public enum PointFormatter implements Converter<String, Point>, Formatter<Point>
|
||||
|
||||
private static final String INVALID_FORMAT = "Expected two doubles separated by a comma but got '%s'!";
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
public Point convert(String source) {
|
||||
@@ -63,19 +59,11 @@ public enum PointFormatter implements Converter<String, Point>, Formatter<Point>
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.format.Printer#print(java.lang.Object, java.util.Locale)
|
||||
*/
|
||||
@Override
|
||||
public String print(Point point, Locale locale) {
|
||||
return point == null ? null : String.format("%s,%s", point.getY(), point.getX());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.format.Parser#parse(java.lang.String, java.util.Locale)
|
||||
*/
|
||||
@Override
|
||||
public Point parse(String text, Locale locale) throws ParseException {
|
||||
return convert(text);
|
||||
|
||||
@@ -81,34 +81,18 @@ public class AnnotationRevisionMetadata<N extends Number & Comparable<N>> implem
|
||||
this.revisionType = revisionType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.history.RevisionMetadata#getRevisionNumber()
|
||||
*/
|
||||
public Optional<N> getRevisionNumber() {
|
||||
return revisionNumber.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.history.RevisionMetadata#getRevisionDate()
|
||||
*/
|
||||
public Optional<Instant> getRevisionInstant() {
|
||||
return revisionDate.get().map(AnnotationRevisionMetadata::convertToInstant);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.history.RevisionMetadata#getRevisionDate()
|
||||
*/
|
||||
public RevisionType getRevisionType() {
|
||||
return revisionType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.history.RevisionMetadata#getDelegate()
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getDelegate() {
|
||||
return (T) entity;
|
||||
|
||||
@@ -96,10 +96,6 @@ public final class Revision<N extends Number & Comparable<N>, T> implements Comp
|
||||
return metadata.getRequiredRevisionInstant();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
public int compareTo(@Nullable Revision<N, ?> that) {
|
||||
|
||||
if (that == null) {
|
||||
@@ -110,10 +106,6 @@ public final class Revision<N extends Number & Comparable<N>, T> implements Comp
|
||||
Comparable::compareTo).orElse(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Revision %s of entity %s - Revision metadata %s",
|
||||
@@ -128,10 +120,6 @@ public final class Revision<N extends Number & Comparable<N>, T> implements Comp
|
||||
return this.entity;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -150,10 +138,6 @@ public final class Revision<N extends Number & Comparable<N>, T> implements Comp
|
||||
return ObjectUtils.nullSafeEquals(entity, revision.entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(metadata);
|
||||
|
||||
@@ -102,10 +102,6 @@ public class Revisions<N extends Number & Comparable<N>, T> implements Streamabl
|
||||
return new Revisions<>(revisions, !latestLast);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
public Iterator<Revision<N, T>> iterator() {
|
||||
return revisions.iterator();
|
||||
}
|
||||
|
||||
@@ -134,10 +134,6 @@ public final class Alias {
|
||||
return isPresent() && type.isInstance(value) ? (T) value : null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return isPresent() ? value.toString() : "NONE";
|
||||
@@ -147,10 +143,6 @@ public final class Alias {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -165,10 +157,6 @@ public final class Alias {
|
||||
return ObjectUtils.nullSafeEquals(value, alias.value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ObjectUtils.nullSafeHashCode(value);
|
||||
|
||||
@@ -286,10 +286,6 @@ public class PreferredConstructor<T, P extends PersistentProperty<P>> {
|
||||
return this.hasSpelExpression.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -316,10 +312,6 @@ public class PreferredConstructor<T, P extends PersistentProperty<P>> {
|
||||
return ObjectUtils.nullSafeEquals(entity, parameter.entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(name);
|
||||
|
||||
@@ -213,10 +213,6 @@ public class PropertyPath implements Streamable<PropertyPath> {
|
||||
return PropertyPath.from(lookup, owningType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
public Iterator<PropertyPath> iterator() {
|
||||
|
||||
return new Iterator<PropertyPath>() {
|
||||
@@ -246,10 +242,6 @@ public class PropertyPath implements Streamable<PropertyPath> {
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -284,10 +276,6 @@ public class PropertyPath implements Streamable<PropertyPath> {
|
||||
return ObjectUtils.nullSafeEquals(next, that.next);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(owningType);
|
||||
@@ -473,10 +461,6 @@ public class PropertyPath implements Streamable<PropertyPath> {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s.%s", owningType.getType().getSimpleName(), toDotPath());
|
||||
@@ -504,10 +488,6 @@ public class PropertyPath implements Streamable<PropertyPath> {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -526,10 +506,6 @@ public class PropertyPath implements Streamable<PropertyPath> {
|
||||
return ObjectUtils.nullSafeEquals(path, key.path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(type);
|
||||
@@ -537,10 +513,6 @@ public class PropertyPath implements Streamable<PropertyPath> {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PropertyPath.Key(type=" + this.getType() + ", path=" + this.getPath() + ")";
|
||||
|
||||
@@ -92,10 +92,6 @@ public class PropertyReferenceException extends RuntimeException {
|
||||
return propertyMatches.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Throwable#getMessage()
|
||||
*/
|
||||
@Override
|
||||
public String getMessage() {
|
||||
|
||||
|
||||
@@ -32,10 +32,6 @@ public abstract class TargetAwareIdentifierAccessor implements IdentifierAccesso
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.IdentifierAccessor#getRequiredIdentifier()
|
||||
*/
|
||||
@Override
|
||||
public Object getRequiredIdentifier() {
|
||||
|
||||
|
||||
@@ -59,10 +59,6 @@ class DefaultEntityCallbacks implements EntityCallbacks {
|
||||
this.callbackDiscoverer = new EntityCallbackDiscoverer(beanFactory);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.callback.EntityCallbacks#callback(java.lang.Class, java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> T callback(Class<? extends EntityCallback> callbackType, T entity, Object... args) {
|
||||
|
||||
@@ -91,10 +87,6 @@ class DefaultEntityCallbacks implements EntityCallbacks {
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.callback.EntityCallbacks#addEntityCallback(org.springframework.data.mapping.callback.EntityCallback)
|
||||
*/
|
||||
@Override
|
||||
public void addEntityCallback(EntityCallback<?> callback) {
|
||||
this.callbackDiscoverer.addEntityCallback(callback);
|
||||
|
||||
@@ -60,10 +60,6 @@ class DefaultReactiveEntityCallbacks implements ReactiveEntityCallbacks {
|
||||
this.callbackDiscoverer = new EntityCallbackDiscoverer(beanFactory);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.callback.ReactiveEntityCallbacks#callback(java.lang.Class, java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> callback(Class<? extends EntityCallback> callbackType, T entity, Object... args) {
|
||||
|
||||
@@ -94,10 +90,6 @@ class DefaultReactiveEntityCallbacks implements ReactiveEntityCallbacks {
|
||||
return deferredCallbackChain;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.callback.EntityCallbacks#addEntityCallback(org.springframework.data.mapping.callback.EntityCallback)
|
||||
*/
|
||||
@Override
|
||||
public void addEntityCallback(EntityCallback<?> callback) {
|
||||
this.callbackDiscoverer.addEntityCallback(callback);
|
||||
|
||||
@@ -415,10 +415,6 @@ class EntityCallbackDiscoverer {
|
||||
this.entityType = entityType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
|
||||
@@ -432,10 +428,6 @@ class EntityCallbackDiscoverer {
|
||||
&& ObjectUtils.nullSafeEquals(this.entityType, otherKey.entityType));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.callbackType.hashCode() * 17 + ObjectUtils.nullSafeHashCode(this.entityType);
|
||||
|
||||
@@ -121,19 +121,11 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
instantiators);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationEventPublisherAware#setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
|
||||
this.applicationEventPublisher = applicationEventPublisher;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
|
||||
@@ -178,10 +170,6 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
this.simpleTypeHolder = simpleTypes;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.MappingContext#getPersistentEntities()
|
||||
*/
|
||||
@Override
|
||||
public Collection<E> getPersistentEntities() {
|
||||
|
||||
@@ -198,19 +186,11 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.MappingContext#getPersistentEntity(java.lang.Class)
|
||||
*/
|
||||
@Nullable
|
||||
public E getPersistentEntity(Class<?> type) {
|
||||
return getPersistentEntity(ClassTypeInformation.from(type));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.MappingContext#hasPersistentEntityFor(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasPersistentEntityFor(Class<?> type) {
|
||||
|
||||
@@ -221,10 +201,6 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
return entity == null ? false : entity.isPresent();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.MappingContext#getPersistentEntity(org.springframework.data.util.TypeInformation)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public E getPersistentEntity(TypeInformation<?> type) {
|
||||
@@ -264,10 +240,6 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
return addPersistentEntity(type).orElse(null);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.MappingContext#getPersistentEntity(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public E getPersistentEntity(P persistentProperty) {
|
||||
@@ -282,28 +254,16 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
return getPersistentEntity(typeInfo.getRequiredActualType());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.MappingContext#getPersistentPropertyPath(java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public PersistentPropertyPath<P> getPersistentPropertyPath(PropertyPath propertyPath) {
|
||||
return persistentPropertyPathFactory.from(propertyPath);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.MappingContext#getPersistentPropertyPath(java.lang.String, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public PersistentPropertyPath<P> getPersistentPropertyPath(String propertyPath, Class<?> type) {
|
||||
return persistentPropertyPathFactory.from(type, propertyPath);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.MappingContext#findPersistentPropertyPath(java.lang.Class, java.util.function.Predicate)
|
||||
*/
|
||||
@Override
|
||||
public <T> PersistentPropertyPaths<T, P> findPersistentPropertyPaths(Class<T> type, Predicate<? super P> predicate) {
|
||||
|
||||
@@ -439,10 +399,6 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentEntityAware#getManagedTypes()
|
||||
*/
|
||||
@Override
|
||||
public Collection<TypeInformation<?>> getManagedTypes() {
|
||||
|
||||
@@ -475,10 +431,6 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
*/
|
||||
protected abstract P createPersistentProperty(Property property, E owner, SimpleTypeHolder simpleTypeHolder);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
initialize();
|
||||
@@ -536,10 +488,6 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
this.remainingDescriptors = remainingDescriptors;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.util.ReflectionUtils.FieldCallback#doWith(java.lang.reflect.Field)
|
||||
*/
|
||||
public void doWith(Field field) {
|
||||
|
||||
var fieldName = field.getName();
|
||||
@@ -706,10 +654,6 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
UNMAPPED_PROPERTIES = Streamable.of(matches);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.util.ReflectionUtils.FieldFilter#matches(java.lang.reflect.Field)
|
||||
*/
|
||||
public boolean matches(Field field) {
|
||||
|
||||
if (Modifier.isStatic(field.getModifiers())) {
|
||||
|
||||
@@ -91,37 +91,21 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
|
||||
return new DefaultPersistentPropertyPath<>(properties);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentPropertyPath#toDotPath()
|
||||
*/
|
||||
@Nullable
|
||||
public String toDotPath() {
|
||||
return toPath(DEFAULT_DELIMITER, DEFAULT_CONVERTER);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentPropertyPath#toDotPath(org.springframework.core.convert.converter.Converter)
|
||||
*/
|
||||
@Nullable
|
||||
public String toDotPath(Converter<? super P, String> converter) {
|
||||
return toPath(DEFAULT_DELIMITER, converter);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentPropertyPath#toPath(java.lang.String)
|
||||
*/
|
||||
@Nullable
|
||||
public String toPath(String delimiter) {
|
||||
return toPath(delimiter, DEFAULT_CONVERTER);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentPropertyPath#toPath(java.lang.String, org.springframework.core.convert.converter.Converter)
|
||||
*/
|
||||
@Nullable
|
||||
public String toPath(String delimiter, Converter<? super P, String> converter) {
|
||||
|
||||
@@ -136,28 +120,16 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
|
||||
return result.isEmpty() ? null : result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentPropertyPath#getLeafProperty()
|
||||
*/
|
||||
@Nullable
|
||||
public P getLeafProperty() {
|
||||
return properties.isEmpty() ? null : properties.get(properties.size() - 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentPropertyPath#getBaseProperty()
|
||||
*/
|
||||
@Nullable
|
||||
public P getBaseProperty() {
|
||||
return properties.isEmpty() ? null : properties.get(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentPropertyPath#isBasePathOf(org.springframework.data.mapping.context.PersistentPropertyPath)
|
||||
*/
|
||||
public boolean isBasePathOf(PersistentPropertyPath<P> path) {
|
||||
|
||||
Assert.notNull(path, "PersistentPropertyPath must not be null!");
|
||||
@@ -180,10 +152,6 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentPropertyPath#getExtensionForBaseOf(org.springframework.data.mapping.context.PersistentPropertyPath)
|
||||
*/
|
||||
public PersistentPropertyPath<P> getExtensionForBaseOf(PersistentPropertyPath<P> base) {
|
||||
|
||||
if (!base.isBasePathOf(this)) {
|
||||
@@ -204,10 +172,6 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
|
||||
return new DefaultPersistentPropertyPath<>(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentPropertyPath#getParentPath()
|
||||
*/
|
||||
public PersistentPropertyPath<P> getParentPath() {
|
||||
|
||||
var size = properties.size();
|
||||
@@ -215,18 +179,10 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
|
||||
return size == 0 ? this : new DefaultPersistentPropertyPath<>(properties.subList(0, size - 1));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.context.PersistentPropertyPath#getLength()
|
||||
*/
|
||||
public int getLength() {
|
||||
return properties.size();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
public Iterator<P> iterator() {
|
||||
return properties.iterator();
|
||||
}
|
||||
@@ -245,10 +201,6 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
|
||||
.anyMatch(property -> type.equals(property.getTypeInformation().getActualType()));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -263,19 +215,11 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
|
||||
return ObjectUtils.nullSafeEquals(properties, that.properties);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ObjectUtils.nullSafeHashCode(properties);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public String toString() {
|
||||
|
||||
@@ -166,10 +166,6 @@ public class PersistentEntities implements Streamable<PersistentEntity<?, ? exte
|
||||
return Streamable.of(target);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<PersistentEntity<?, ? extends PersistentProperty<?>>> iterator() {
|
||||
|
||||
|
||||
@@ -293,10 +293,6 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
|
||||
return this.path;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -315,10 +311,6 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
|
||||
return ObjectUtils.nullSafeEquals(path, that.path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(type);
|
||||
@@ -326,10 +318,6 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PersistentPropertyPathFactory.TypeAndPath(type=" + this.getType() + ", path=" + this.getPath() + ")";
|
||||
@@ -367,28 +355,16 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
|
||||
return new DefaultPersistentPropertyPaths<>(type, sorted);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyPaths#getFirst()
|
||||
*/
|
||||
@Override
|
||||
public Optional<PersistentPropertyPath<P>> getFirst() {
|
||||
return isEmpty() ? Optional.empty() : Optional.of(iterator().next());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyPaths#contains(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public boolean contains(String path) {
|
||||
return contains(PropertyPath.from(path, type));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyPaths#contains(org.springframework.data.mapping.PropertyPath)
|
||||
*/
|
||||
@Override
|
||||
public boolean contains(PropertyPath path) {
|
||||
|
||||
@@ -403,19 +379,11 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
|
||||
return stream().anyMatch(it -> dotPath.equals(it.toDotPath()));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<PersistentPropertyPath<P>> iterator() {
|
||||
return paths.iterator();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyPaths#dropPathIfSegmentMatches(java.util.function.Predicate)
|
||||
*/
|
||||
@Override
|
||||
public PersistentPropertyPaths<T, P> dropPathIfSegmentMatches(Predicate<? super P> predicate) {
|
||||
|
||||
@@ -428,10 +396,6 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
|
||||
return paths.equals(this.paths) ? this : new DefaultPersistentPropertyPaths<>(type, paths);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PersistentPropertyPathFactory.DefaultPersistentPropertyPaths(type=" + this.type + ", paths=" + this.paths
|
||||
|
||||
@@ -113,55 +113,31 @@ public abstract class AbstractPersistentProperty<P extends PersistentProperty<P>
|
||||
|
||||
protected abstract Association<P> createAssociation();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getOwner()
|
||||
*/
|
||||
@Override
|
||||
public PersistentEntity<?, P> getOwner() {
|
||||
return this.owner;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getName()
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getType() {
|
||||
return information.getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getRawType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getRawType() {
|
||||
return this.rawType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getTypeInformation()
|
||||
*/
|
||||
@Override
|
||||
public TypeInformation<?> getTypeInformation() {
|
||||
return information;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getPersistentEntityTypeInformation()
|
||||
*/
|
||||
@Override
|
||||
public Iterable<? extends TypeInformation<?>> getPersistentEntityTypeInformation() {
|
||||
|
||||
@@ -176,105 +152,61 @@ public abstract class AbstractPersistentProperty<P extends PersistentProperty<P>
|
||||
return entityTypeInformation.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getGetter()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Method getGetter() {
|
||||
return this.getter;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getSetter()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Method getSetter() {
|
||||
return this.setter;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getWither()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Method getWither() {
|
||||
return this.wither;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getField()
|
||||
*/
|
||||
@Nullable
|
||||
public Field getField() {
|
||||
return this.field;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getSpelExpression()
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public String getSpelExpression() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#isTransient()
|
||||
*/
|
||||
@Override
|
||||
public boolean isTransient() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#isWritable()
|
||||
*/
|
||||
@Override
|
||||
public boolean isWritable() {
|
||||
return !isTransient();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#isImmutable()
|
||||
*/
|
||||
@Override
|
||||
public boolean isImmutable() {
|
||||
return immutable;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#isAssociation()
|
||||
*/
|
||||
@Override
|
||||
public boolean isAssociation() {
|
||||
return isAssociation.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getAssociation()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Association<P> getAssociation() {
|
||||
return association.orElse(null);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getAssociationTargetType()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<?> getAssociationTargetType() {
|
||||
@@ -284,66 +216,38 @@ public abstract class AbstractPersistentProperty<P extends PersistentProperty<P>
|
||||
return result != null ? result.getType() : null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getAssociationTargetTypeInformation()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public TypeInformation<?> getAssociationTargetTypeInformation() {
|
||||
return associationTargetType.getNullable();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#isCollectionLike()
|
||||
*/
|
||||
@Override
|
||||
public boolean isCollectionLike() {
|
||||
return information.isCollectionLike();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#isMap()
|
||||
*/
|
||||
@Override
|
||||
public boolean isMap() {
|
||||
return Map.class.isAssignableFrom(getType());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#isArray()
|
||||
*/
|
||||
@Override
|
||||
public boolean isArray() {
|
||||
return getType().isArray();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#isEntity()
|
||||
*/
|
||||
@Override
|
||||
public boolean isEntity() {
|
||||
return !isTransient() && !entityTypeInformation.get().isEmpty();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getComponentType()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<?> getComponentType() {
|
||||
return isMap() || isCollectionLike() ? information.getRequiredComponentType().getType() : null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getMapValueType()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<?> getMapValueType() {
|
||||
@@ -360,19 +264,11 @@ public abstract class AbstractPersistentProperty<P extends PersistentProperty<P>
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#getActualType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getActualType() {
|
||||
return getActualTypeInformation().getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.mapping.MongoPersistentProperty#usePropertyAccess()
|
||||
*/
|
||||
public boolean usePropertyAccess() {
|
||||
return usePropertyAccess.get();
|
||||
}
|
||||
@@ -387,10 +283,6 @@ public abstract class AbstractPersistentProperty<P extends PersistentProperty<P>
|
||||
return targetType == null ? information.getRequiredActualType() : targetType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -405,19 +297,11 @@ public abstract class AbstractPersistentProperty<P extends PersistentProperty<P>
|
||||
return this.property.equals(that.property);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.hashCode.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return property.toString();
|
||||
|
||||
@@ -199,18 +199,10 @@ public abstract class AnnotationBasedPersistentProperty<P extends PersistentProp
|
||||
return isTransient.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#isIdProperty()
|
||||
*/
|
||||
public boolean isIdProperty() {
|
||||
return isId.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#isVersionProperty()
|
||||
*/
|
||||
public boolean isVersionProperty() {
|
||||
return isVersion.get();
|
||||
}
|
||||
@@ -223,10 +215,6 @@ public abstract class AnnotationBasedPersistentProperty<P extends PersistentProp
|
||||
return isReference.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.AbstractPersistentProperty#isWritable()
|
||||
*/
|
||||
@Override
|
||||
public boolean isWritable() {
|
||||
return isWritable.get();
|
||||
@@ -266,10 +254,6 @@ public abstract class AnnotationBasedPersistentProperty<P extends PersistentProp
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentProperty#findPropertyOrOwnerAnnotation(java.lang.Class)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public <A extends Annotation> A findPropertyOrOwnerAnnotation(Class<A> annotationType) {
|
||||
@@ -289,29 +273,17 @@ public abstract class AnnotationBasedPersistentProperty<P extends PersistentProp
|
||||
return doFindAnnotation(annotationType).isPresent();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.AbstractPersistentProperty#usePropertyAccess()
|
||||
*/
|
||||
@Override
|
||||
public boolean usePropertyAccess() {
|
||||
return usePropertyAccess.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.AbstractPersistentProperty#getAssociationTargetTypeInformation()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public TypeInformation<?> getAssociationTargetTypeInformation() {
|
||||
return associationTargetType.getNullable();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.AbstractPersistentProperty#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
|
||||
@@ -127,85 +127,45 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
.anyMatch(it -> !(isConstructorArgument(it) || it.isTransient())));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getPersistenceConstructor()
|
||||
*/
|
||||
@Nullable
|
||||
public PreferredConstructor<T, P> getPersistenceConstructor() {
|
||||
return constructor;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#isConstructorArgument(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
public boolean isConstructorArgument(PersistentProperty<?> property) {
|
||||
return constructor != null && constructor.isConstructorParameter(property);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#isIdProperty(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
public boolean isIdProperty(PersistentProperty<?> property) {
|
||||
return idProperty != null && idProperty.equals(property);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#isVersionProperty(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
public boolean isVersionProperty(PersistentProperty<?> property) {
|
||||
return versionProperty != null && versionProperty.equals(property);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getName()
|
||||
*/
|
||||
public String getName() {
|
||||
return getType().getName();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getIdProperty()
|
||||
*/
|
||||
@Nullable
|
||||
public P getIdProperty() {
|
||||
return idProperty;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getVersionProperty()
|
||||
*/
|
||||
@Nullable
|
||||
public P getVersionProperty() {
|
||||
return versionProperty;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#hasIdProperty()
|
||||
*/
|
||||
public boolean hasIdProperty() {
|
||||
return idProperty != null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#hasVersionProperty()
|
||||
*/
|
||||
public boolean hasVersionProperty() {
|
||||
return versionProperty != null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.MutablePersistentEntity#addPersistentProperty(P)
|
||||
*/
|
||||
public void addPersistentProperty(P property) {
|
||||
|
||||
Assert.notNull(property, "Property must not be null!");
|
||||
@@ -245,10 +205,6 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.MutablePersistentEntity#setEvaluationContextProvider(org.springframework.data.spel.EvaluationContextProvider)
|
||||
*/
|
||||
@Override
|
||||
public void setEvaluationContextProvider(EvaluationContextProvider provider) {
|
||||
this.evaluationContextProvider = provider;
|
||||
@@ -277,10 +233,6 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
return property;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.MutablePersistentEntity#addAssociation(org.springframework.data.mapping.model.Association)
|
||||
*/
|
||||
public void addAssociation(Association<P> association) {
|
||||
|
||||
Assert.notNull(association, "Association must not be null!");
|
||||
@@ -288,20 +240,12 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
associations.add(association);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getPersistentProperty(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public P getPersistentProperty(String name) {
|
||||
return propertyCache.get(name);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getPersistentProperties(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Iterable<P> getPersistentProperties(Class<? extends Annotation> annotationType) {
|
||||
|
||||
@@ -324,34 +268,18 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
.filter(it -> it.isAnnotationPresent(annotationType)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getType()
|
||||
*/
|
||||
public Class<T> getType() {
|
||||
return information.getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getTypeAlias()
|
||||
*/
|
||||
public Alias getTypeAlias() {
|
||||
return typeAlias.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getTypeInformation()
|
||||
*/
|
||||
public TypeInformation<T> getTypeInformation() {
|
||||
return information;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#doWithProperties(org.springframework.data.mapping.PropertyHandler)
|
||||
*/
|
||||
public void doWithProperties(PropertyHandler<P> handler) {
|
||||
|
||||
Assert.notNull(handler, "PropertyHandler must not be null!");
|
||||
@@ -361,10 +289,6 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#doWithProperties(org.springframework.data.mapping.PropertyHandler.Simple)
|
||||
*/
|
||||
@Override
|
||||
public void doWithProperties(SimplePropertyHandler handler) {
|
||||
|
||||
@@ -375,10 +299,6 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#doWithAssociations(org.springframework.data.mapping.AssociationHandler)
|
||||
*/
|
||||
public void doWithAssociations(AssociationHandler<P> handler) {
|
||||
|
||||
Assert.notNull(handler, "Handler must not be null!");
|
||||
@@ -388,10 +308,6 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#doWithAssociations(org.springframework.data.mapping.SimpleAssociationHandler)
|
||||
*/
|
||||
public void doWithAssociations(SimpleAssociationHandler handler) {
|
||||
|
||||
Assert.notNull(handler, "Handler must not be null!");
|
||||
@@ -401,20 +317,12 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#findAnnotation(java.lang.Class)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public <A extends Annotation> A findAnnotation(Class<A> annotationType) {
|
||||
return doFindAnnotation(annotationType).orElse(null);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#isAnnotationPresent(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <A extends Annotation> boolean isAnnotationPresent(Class<A> annotationType) {
|
||||
return doFindAnnotation(annotationType).isPresent();
|
||||
@@ -427,10 +335,6 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
it -> Optional.ofNullable(AnnotatedElementUtils.findMergedAnnotation(getType(), it)));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.MutablePersistentEntity#verify()
|
||||
*/
|
||||
public void verify() {
|
||||
|
||||
if (comparator != null) {
|
||||
@@ -439,19 +343,11 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.MutablePersistentEntity#setPersistentPropertyAccessorFactory(org.springframework.data.mapping.model.PersistentPropertyAccessorFactory)
|
||||
*/
|
||||
@Override
|
||||
public void setPersistentPropertyAccessorFactory(PersistentPropertyAccessorFactory factory) {
|
||||
this.propertyAccessorFactory = factory;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getPropertyAccessor(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <B> PersistentPropertyAccessor<B> getPropertyAccessor(B bean) {
|
||||
|
||||
@@ -460,19 +356,11 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
return propertyAccessorFactory.getPropertyAccessor(this, bean);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getPropertyPathAccessor(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <B> PersistentPropertyPathAccessor<B> getPropertyPathAccessor(B bean) {
|
||||
return new SimplePersistentPropertyPathAccessor<>(getPropertyAccessor(bean));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#getIdentifierAccessor(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public IdentifierAccessor getIdentifierAccessor(Object bean) {
|
||||
|
||||
@@ -485,10 +373,6 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
return hasIdProperty() ? new IdPropertyIdentifierAccessor(this, bean) : new AbsentIdentifierAccessor(bean);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#isNew(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean isNew(Object bean) {
|
||||
|
||||
@@ -497,28 +381,16 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
return isNewStrategy.get().isNew(bean);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#isImmutable()
|
||||
*/
|
||||
@Override
|
||||
public boolean isImmutable() {
|
||||
return isImmutable.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentEntity#requiresPropertyPopulation()
|
||||
*/
|
||||
@Override
|
||||
public boolean requiresPropertyPopulation() {
|
||||
return requiresPropertyPopulation.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<P> iterator() {
|
||||
|
||||
@@ -614,10 +486,6 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
super(target);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.IdentifierAccessor#getIdentifier()
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public Object getIdentifier() {
|
||||
@@ -640,10 +508,6 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
public int compare(@Nullable Association<P> left, @Nullable Association<P> right) {
|
||||
|
||||
if (left == null) {
|
||||
|
||||
@@ -52,10 +52,6 @@ class BeanWrapper<T> implements PersistentPropertyAccessor<T> {
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#setProperty(org.springframework.data.mapping.PersistentProperty, java.util.Optional)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setProperty(PersistentProperty<?> property, @Nullable Object value) {
|
||||
|
||||
@@ -103,10 +99,6 @@ class BeanWrapper<T> implements PersistentPropertyAccessor<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#getProperty(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Nullable
|
||||
public Object getProperty(PersistentProperty<?> property) {
|
||||
return getProperty(property, property.getType());
|
||||
@@ -147,10 +139,6 @@ class BeanWrapper<T> implements PersistentPropertyAccessor<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#getBean()
|
||||
*/
|
||||
public T getBean() {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@@ -27,19 +27,11 @@ public enum BeanWrapperPropertyAccessorFactory implements PersistentPropertyAcce
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.PersistentPropertyAccessorFactory#getPropertyAccessor(org.springframework.data.mapping.PersistentEntity, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> PersistentPropertyAccessor<T> getPropertyAccessor(PersistentEntity<?, ?> entity, T bean) {
|
||||
return new BeanWrapper<>(bean);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.PersistentPropertyAccessorFactory#isSupported(org.springframework.data.mapping.PersistentEntity)
|
||||
*/
|
||||
@Override
|
||||
public boolean isSupported(PersistentEntity<?, ?> entity) {
|
||||
return true;
|
||||
|
||||
@@ -31,10 +31,6 @@ public class CamelCaseAbbreviatingFieldNamingStrategy extends CamelCaseSplitting
|
||||
super("");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.mapping.CamelCaseSplittingFieldNamingStrategy#preparePart(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected String preparePart(String part) {
|
||||
return part.substring(0, 1);
|
||||
|
||||
@@ -45,10 +45,6 @@ public class CamelCaseSplittingFieldNamingStrategy implements FieldNamingStrateg
|
||||
this.delimiter = delimiter;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.FieldNamingStrategy#getFieldName(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Override
|
||||
public String getFieldName(PersistentProperty<?> property) {
|
||||
|
||||
|
||||
@@ -71,10 +71,6 @@ class ClassGeneratingEntityInstantiator implements EntityInstantiator {
|
||||
this.generator = new ObjectInstantiatorClassGenerator();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.EntityInstantiator#createInstance(org.springframework.data.mapping.PersistentEntity, org.springframework.data.mapping.model.ParameterValueProvider)
|
||||
*/
|
||||
@Override
|
||||
public <T, E extends PersistentEntity<? extends T, P>, P extends PersistentProperty<P>> T createInstance(E entity,
|
||||
ParameterValueProvider<P> provider) {
|
||||
@@ -235,10 +231,6 @@ class ClassGeneratingEntityInstantiator implements EntityInstantiator {
|
||||
this.instantiator = instantiator;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.EntityInstantiator#createInstance(org.springframework.data.mapping.PersistentEntity, org.springframework.data.mapping.model.ParameterValueProvider)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T, E extends PersistentEntity<? extends T, P>, P extends PersistentProperty<P>> T createInstance(E entity,
|
||||
@@ -307,10 +299,6 @@ class ClassGeneratingEntityInstantiator implements EntityInstantiator {
|
||||
return new MappingInstantiationExceptionEntityInstantiator(typeToCreate);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.EntityInstantiator#createInstance(org.springframework.data.mapping.PersistentEntity, org.springframework.data.mapping.model.ParameterValueProvider)
|
||||
*/
|
||||
@Override
|
||||
public <T, E extends PersistentEntity<? extends T, P>, P extends PersistentProperty<P>> T createInstance(E entity,
|
||||
ParameterValueProvider<P> provider) {
|
||||
|
||||
@@ -75,10 +75,6 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert
|
||||
private volatile Map<TypeInformation<?>, Class<PersistentPropertyAccessor<?>>> propertyAccessorClasses = new HashMap<>(
|
||||
32);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.PersistentPropertyAccessorFactory#getPropertyAccessor(org.springframework.data.mapping.PersistentEntity, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> PersistentPropertyAccessor<T> getPropertyAccessor(PersistentEntity<?, ?> entity, T bean) {
|
||||
|
||||
@@ -1403,10 +1399,6 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert
|
||||
this.hash = hash;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(PropertyStackAddress o) {
|
||||
return Integer.compare(hash, o.hash);
|
||||
|
||||
@@ -54,19 +54,11 @@ public class ConvertingPropertyAccessor<T> extends SimplePersistentPropertyPathA
|
||||
this.conversionService = conversionService;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#setProperty(org.springframework.data.mapping.PersistentProperty, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void setProperty(PersistentProperty<?> property, @Nullable Object value) {
|
||||
accessor.setProperty(property, convertIfNecessary(value, property.getType()));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#setProperty(org.springframework.data.mapping.PersistentPropertyPath, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, @Nullable Object value) {
|
||||
|
||||
@@ -91,10 +83,6 @@ public class ConvertingPropertyAccessor<T> extends SimplePersistentPropertyPathA
|
||||
return convertIfNecessary(getProperty(property), targetType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.SimplePersistentPropertyPathAccessor#getTypedProperty(org.springframework.data.mapping.PersistentProperty, java.lang.Class)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
protected <S> S getTypedProperty(PersistentProperty<?> property, Class<S> type) {
|
||||
|
||||
@@ -42,10 +42,6 @@ public class DefaultSpELExpressionEvaluator implements SpELExpressionEvaluator {
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.SpELExpressionEvaluator#evaluate(java.lang.String)
|
||||
*/
|
||||
@Nullable
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T evaluate(String expression) {
|
||||
|
||||
@@ -54,10 +54,6 @@ public class IdPropertyIdentifierAccessor extends TargetAwareIdentifierAccessor
|
||||
this.accessor = entity.getPropertyAccessor(target);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.keyvalue.core.IdentifierAccessor#getIdentifier()
|
||||
*/
|
||||
@Nullable
|
||||
public Object getIdentifier() {
|
||||
return accessor.getProperty(idProperty);
|
||||
|
||||
@@ -66,10 +66,6 @@ public class InstantiationAwarePropertyAccessor<T> implements PersistentProperty
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#setProperty(org.springframework.data.mapping.PersistentProperty, java.lang.Object)
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void setProperty(PersistentProperty<?> property, @Nullable Object value) {
|
||||
@@ -124,20 +120,12 @@ public class InstantiationAwarePropertyAccessor<T> implements PersistentProperty
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#getProperty(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getProperty(PersistentProperty<?> property) {
|
||||
return delegateFunction.apply(bean).getProperty(property);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#getBean()
|
||||
*/
|
||||
@Override
|
||||
public T getBean() {
|
||||
return this.bean;
|
||||
|
||||
@@ -37,20 +37,12 @@ public class InstantiationAwarePropertyAccessorFactory implements PersistentProp
|
||||
this.instantiators = instantiators;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.PersistentPropertyAccessorFactory#getPropertyAccessor(org.springframework.data.mapping.PersistentEntity, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> PersistentPropertyAccessor<T> getPropertyAccessor(PersistentEntity<?, ?> entity, T bean) {
|
||||
return new InstantiationAwarePropertyAccessor<>(bean, it -> delegate.getPropertyAccessor(entity, it),
|
||||
instantiators);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.PersistentPropertyAccessorFactory#isSupported(org.springframework.data.mapping.PersistentEntity)
|
||||
*/
|
||||
@Override
|
||||
public boolean isSupported(PersistentEntity<?, ?> entity) {
|
||||
return delegate.isSupported(entity);
|
||||
|
||||
@@ -42,10 +42,6 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
class KotlinClassGeneratingEntityInstantiator extends ClassGeneratingEntityInstantiator {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.ClassGeneratingEntityInstantiator#doCreateEntityInstantiator(org.springframework.data.mapping.PersistentEntity)
|
||||
*/
|
||||
@Override
|
||||
protected EntityInstantiator doCreateEntityInstantiator(PersistentEntity<?, ?> entity) {
|
||||
|
||||
@@ -190,10 +186,6 @@ class KotlinClassGeneratingEntityInstantiator extends ClassGeneratingEntityInsta
|
||||
this.synthetic = constructor.getConstructor();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.EntityInstantiator#createInstance(org.springframework.data.mapping.PersistentEntity, org.springframework.data.mapping.model.ParameterValueProvider)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T, E extends PersistentEntity<? extends T, P>, P extends PersistentProperty<P>> T createInstance(E entity,
|
||||
|
||||
@@ -41,10 +41,6 @@ class PersistableIdentifierAccessor extends TargetAwareIdentifierAccessor {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.IdentifierAccessor#getIdentifier()
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public Object getIdentifier() {
|
||||
|
||||
@@ -86,10 +86,6 @@ class PersistentEntityIsNewStrategy implements IsNewStrategy {
|
||||
return new PersistentEntityIsNewStrategy(entity, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.support.IsNewStrategy#isNew(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean isNew(Object entity) {
|
||||
|
||||
|
||||
@@ -43,10 +43,6 @@ public class PersistentEntityParameterValueProvider<P extends PersistentProperty
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.ParameterValueProvider#getParameterValue(org.springframework.data.mapping.PreferredConstructor.Parameter)
|
||||
*/
|
||||
@Nullable
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getParameterValue(Parameter<T, P> parameter) {
|
||||
|
||||
@@ -98,10 +98,6 @@ public interface PreferredConstructorDiscoverer<T, P extends PersistentProperty<
|
||||
*/
|
||||
DEFAULT {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.PreferredConstructorDiscoverers#discover(org.springframework.data.util.TypeInformation, org.springframework.data.mapping.PersistentEntity)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
<T, P extends PersistentProperty<P>> PreferredConstructor<T, P> discover(TypeInformation<T> type,
|
||||
@@ -143,10 +139,6 @@ public interface PreferredConstructorDiscoverer<T, P extends PersistentProperty<
|
||||
*/
|
||||
KOTLIN {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.PreferredConstructorDiscoverers#discover(org.springframework.data.util.TypeInformation, org.springframework.data.mapping.PersistentEntity)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
<T, P extends PersistentProperty<P>> PreferredConstructor<T, P> discover(TypeInformation<T> type,
|
||||
|
||||
@@ -212,10 +212,6 @@ public class Property {
|
||||
return rawType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -230,19 +226,11 @@ public class Property {
|
||||
return this.field.isPresent() ? this.field.equals(that.field) : this.descriptor.equals(that.descriptor);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return hashCode.get();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return toString.get();
|
||||
|
||||
@@ -27,10 +27,6 @@ public enum PropertyNameFieldNamingStrategy implements FieldNamingStrategy {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.FieldNamingStrategy#getFieldName(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
public String getFieldName(PersistentProperty<?> property) {
|
||||
return property.getName();
|
||||
}
|
||||
|
||||
@@ -59,39 +59,23 @@ class SimplePersistentPropertyPathAccessor<T> implements PersistentPropertyPathA
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#getBean()
|
||||
*/
|
||||
@Override
|
||||
public T getBean() {
|
||||
return delegate.getBean();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#getProperty(org.springframework.data.mapping.PersistentProperty)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getProperty(PersistentProperty<?> property) {
|
||||
return delegate.getProperty(property);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyPathAccessor#getProperty(org.springframework.data.mapping.PersistentPropertyPath)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path) {
|
||||
return getProperty(path, DEFAULT_GET_OPTIONS);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyPathAccessor#getProperty(org.springframework.data.mapping.PersistentPropertyPath, org.springframework.data.mapping.PersistentPropertyPathAccessor.Options)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, GetOptions options) {
|
||||
@@ -118,28 +102,16 @@ class SimplePersistentPropertyPathAccessor<T> implements PersistentPropertyPathA
|
||||
return current;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyAccessor#setProperty(org.springframework.data.mapping.PersistentProperty, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void setProperty(PersistentProperty<?> property, @Nullable Object value) {
|
||||
delegate.setProperty(property, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.PersistentPropertyPathAccessor#setProperty(org.springframework.data.mapping.PersistentPropertyPath, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, @Nullable Object value) {
|
||||
setProperty(path, value, AccessOptions.defaultSetOptions());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.ConvertingPropertyAccessor#setProperty(org.springframework.data.mapping.PersistentPropertyPath, java.lang.Object)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, @Nullable Object value,
|
||||
|
||||
@@ -86,18 +86,10 @@ public class SpELContext {
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.SpELContext#getParser()
|
||||
*/
|
||||
public ExpressionParser getParser() {
|
||||
return this.parser;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.SpELContext#getEvaluationContext(java.lang.Object)
|
||||
*/
|
||||
public EvaluationContext getEvaluationContext(Object source) {
|
||||
|
||||
var evaluationContext = new StandardEvaluationContext(source);
|
||||
|
||||
@@ -42,10 +42,6 @@ public class SpELExpressionParameterValueProvider<P extends PersistentProperty<P
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.ParameterValueProvider#getParameterValue(org.springframework.data.mapping.PreferredConstructor.Parameter)
|
||||
*/
|
||||
@Nullable
|
||||
public <T> T getParameterValue(Parameter<T, P> parameter) {
|
||||
|
||||
|
||||
@@ -66,10 +66,6 @@ public class DefaultMethodInvokingMethodInterceptor implements MethodInterceptor
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Object invoke(@SuppressWarnings("null") MethodInvocation invocation) throws Throwable {
|
||||
@@ -114,10 +110,6 @@ public class DefaultMethodInvokingMethodInterceptor implements MethodInterceptor
|
||||
private final @Nullable Method privateLookupIn = ReflectionUtils.findMethod(MethodHandles.class,
|
||||
"privateLookupIn", Class.class, Lookup.class);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.MethodHandleLookup#lookup(java.lang.reflect.Method)
|
||||
*/
|
||||
@Override
|
||||
MethodHandle lookup(Method method) throws ReflectiveOperationException {
|
||||
|
||||
@@ -128,10 +120,6 @@ public class DefaultMethodInvokingMethodInterceptor implements MethodInterceptor
|
||||
return doLookup(method, getLookup(method.getDeclaringClass(), privateLookupIn));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.MethodHandleLookup#isAvailable()
|
||||
*/
|
||||
@Override
|
||||
boolean isAvailable() {
|
||||
return privateLookupIn != null;
|
||||
@@ -157,10 +145,6 @@ public class DefaultMethodInvokingMethodInterceptor implements MethodInterceptor
|
||||
|
||||
private final Lazy<Constructor<Lookup>> constructor = Lazy.of(MethodHandleLookup::getLookupConstructor);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.MethodHandleLookup#lookup(java.lang.reflect.Method)
|
||||
*/
|
||||
@Override
|
||||
MethodHandle lookup(Method method) throws ReflectiveOperationException {
|
||||
|
||||
@@ -173,10 +157,6 @@ public class DefaultMethodInvokingMethodInterceptor implements MethodInterceptor
|
||||
return constructor.newInstance(method.getDeclaringClass()).unreflectSpecial(method, method.getDeclaringClass());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.MethodHandleLookup#isAvailable()
|
||||
*/
|
||||
@Override
|
||||
boolean isAvailable() {
|
||||
return constructor.orElse(null) != null;
|
||||
@@ -190,19 +170,11 @@ public class DefaultMethodInvokingMethodInterceptor implements MethodInterceptor
|
||||
*/
|
||||
FALLBACK {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.MethodHandleLookup#lookup(java.lang.reflect.Method)
|
||||
*/
|
||||
@Override
|
||||
MethodHandle lookup(Method method) throws ReflectiveOperationException {
|
||||
return doLookup(method, MethodHandles.lookup());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.MethodHandleLookup#isAvailable()
|
||||
*/
|
||||
@Override
|
||||
boolean isAvailable() {
|
||||
return true;
|
||||
|
||||
@@ -65,19 +65,11 @@ class DefaultProjectionInformation implements ProjectionInformation {
|
||||
this.properties = new PropertyDescriptorSource(type).getDescriptors();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.ProjectionInformation#getType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getType() {
|
||||
return projectionType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.ProjectionInformation#getInputProperties()
|
||||
*/
|
||||
public List<PropertyDescriptor> getInputProperties() {
|
||||
|
||||
return properties.stream()//
|
||||
@@ -86,10 +78,6 @@ class DefaultProjectionInformation implements ProjectionInformation {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.ProjectionInformation#isDynamic()
|
||||
*/
|
||||
@Override
|
||||
public boolean isClosed() {
|
||||
return this.properties.equals(getInputProperties());
|
||||
|
||||
@@ -41,10 +41,6 @@ class MapAccessingMethodInterceptor implements MethodInterceptor {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Object invoke(@SuppressWarnings("null") MethodInvocation invocation) throws Throwable {
|
||||
|
||||
@@ -61,10 +61,6 @@ class ProjectingMethodInterceptor implements MethodInterceptor {
|
||||
this.conversionService = conversionService;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Object invoke(@SuppressWarnings("null") @NonNull MethodInvocation invocation) throws Throwable {
|
||||
|
||||
@@ -49,10 +49,6 @@ class PropertyAccessingMethodInterceptor implements MethodInterceptor {
|
||||
this.target = new DirectFieldAccessFallbackBeanWrapper(target);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Object invoke(@SuppressWarnings("null") MethodInvocation invocation) throws Throwable {
|
||||
|
||||
@@ -72,10 +72,6 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware
|
||||
this.factories.add(PropertyAccessingMethodInvokerFactory.INSTANCE);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.BeanClassLoaderAware#setBeanClassLoader(java.lang.ClassLoader)
|
||||
*/
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
this.classLoader = classLoader;
|
||||
@@ -95,10 +91,6 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware
|
||||
this.factories.add(0, factory);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.rest.core.projection.ProjectionFactory#createProjection(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T createProjection(Class<T> projectionType, Object source) {
|
||||
@@ -123,10 +115,6 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware
|
||||
return (T) factory.getProxy(classLoader == null ? ClassUtils.getDefaultClassLoader() : classLoader);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.ProjectionFactory#createProjection(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> T createProjection(Class<T> projectionType) {
|
||||
|
||||
@@ -135,10 +123,6 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware
|
||||
return createProjection(projectionType, new HashMap<String, Object>());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.ProjectionFactory#getProjectionInformation(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public final ProjectionInformation getProjectionInformation(Class<?> projectionType) {
|
||||
|
||||
@@ -236,10 +220,6 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware
|
||||
this.targetType = targetType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Object invoke(@SuppressWarnings("null") MethodInvocation invocation) throws Throwable {
|
||||
@@ -263,20 +243,12 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.MethodInterceptorFactory#createMethodInterceptor(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public MethodInterceptor createMethodInterceptor(Object source, Class<?> targetType) {
|
||||
return new MapAccessingMethodInterceptor((Map<String, Object>) source);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.MethodInterceptorFactory#supports(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(Object source, Class<?> targetType) {
|
||||
return Map.class.isInstance(source);
|
||||
@@ -292,19 +264,11 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware
|
||||
|
||||
INSTANCE;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.MethodInterceptorFactory#createMethodInterceptor(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public MethodInterceptor createMethodInterceptor(Object source, Class<?> targetType) {
|
||||
return new PropertyAccessingMethodInterceptor(source);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.MethodInterceptorFactory#supports(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(Object source, Class<?> targetType) {
|
||||
return true;
|
||||
|
||||
@@ -49,19 +49,11 @@ public class SpelAwareProxyProjectionFactory extends ProxyProjectionFactory impl
|
||||
|
||||
private @Nullable BeanFactory beanFactory;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
|
||||
*/
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.ProxyProjectionFactory#createProjectionInformation(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
protected ProjectionInformation createProjectionInformation(Class<?> projectionType) {
|
||||
return new SpelAwareProjectionInformation(projectionType);
|
||||
@@ -107,10 +99,6 @@ public class SpelAwareProxyProjectionFactory extends ProxyProjectionFactory impl
|
||||
super(projectionType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.projection.DefaultProjectionInformation#isInputProperty(java.beans.PropertyDescriptor)
|
||||
*/
|
||||
@Override
|
||||
protected boolean isInputProperty(PropertyDescriptor descriptor) {
|
||||
|
||||
|
||||
@@ -124,10 +124,6 @@ class SpelEvaluatingMethodInterceptor implements MethodInterceptor {
|
||||
return Collections.unmodifiableMap(expressions);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Object invoke(@SuppressWarnings("null") MethodInvocation invocation) throws Throwable {
|
||||
@@ -168,10 +164,6 @@ class SpelEvaluatingMethodInterceptor implements MethodInterceptor {
|
||||
return this.args;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -190,10 +182,6 @@ class SpelEvaluatingMethodInterceptor implements MethodInterceptor {
|
||||
return ObjectUtils.nullSafeEquals(args, that.args);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(target);
|
||||
@@ -201,10 +189,6 @@ class SpelEvaluatingMethodInterceptor implements MethodInterceptor {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SpelEvaluatingMethodInterceptor.TargetWrapper(target=" + this.getTarget() + ", args="
|
||||
|
||||
@@ -127,37 +127,21 @@ public class QPageRequest extends AbstractPageRequest {
|
||||
return QPageRequest.of(0, pageSize);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#getSort()
|
||||
*/
|
||||
@Override
|
||||
public Sort getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.AbstractPageRequest#next()
|
||||
*/
|
||||
@Override
|
||||
public Pageable next() {
|
||||
return QPageRequest.of(getPageNumber() + 1, getPageSize(), sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.AbstractPageRequest#previous()
|
||||
*/
|
||||
@Override
|
||||
public Pageable previous() {
|
||||
return QPageRequest.of(getPageNumber() - 1, getPageSize(), sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.AbstractPageRequest#first()
|
||||
*/
|
||||
@Override
|
||||
public Pageable first() {
|
||||
return QPageRequest.of(0, getPageSize(), sort);
|
||||
|
||||
@@ -57,92 +57,52 @@ public class QuerydslRepositoryInvokerAdapter implements RepositoryInvoker {
|
||||
this.predicate = predicate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokePagedFindAll(org.springframework.data.domain.Pageable)
|
||||
*/
|
||||
@Override
|
||||
public Iterable<Object> invokeFindAll(Pageable pageable) {
|
||||
return executor.findAll(predicate, pageable);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeSortedFindAll(org.springframework.data.domain.Sort)
|
||||
*/
|
||||
@Override
|
||||
public Iterable<Object> invokeFindAll(Sort sort) {
|
||||
return executor.findAll(predicate, sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasDeleteMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasDeleteMethod() {
|
||||
return delegate.hasDeleteMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasFindAllMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasFindAllMethod() {
|
||||
return delegate.hasFindAllMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasFindOneMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasFindOneMethod() {
|
||||
return delegate.hasFindOneMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasSaveMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasSaveMethod() {
|
||||
return delegate.hasSaveMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeDeleteById(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void invokeDeleteById(Object id) {
|
||||
delegate.invokeDeleteById(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeFindById(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> Optional<T> invokeFindById(Object id) {
|
||||
return delegate.invokeFindById(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeQueryMethod(java.lang.reflect.Method, org.springframework.util.MultiValueMap, org.springframework.data.domain.Pageable, org.springframework.data.domain.Sort)
|
||||
*/
|
||||
@Override
|
||||
public Optional<Object> invokeQueryMethod(Method method, MultiValueMap<String, ? extends Object> parameters,
|
||||
Pageable pageable, Sort sort) {
|
||||
return delegate.invokeQueryMethod(method, parameters, pageable, sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeSave(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> T invokeSave(T object) {
|
||||
return delegate.invokeSave(object);
|
||||
|
||||
@@ -64,65 +64,37 @@ record PropertyPathInformation(PropertyPath path) implements PathInformation {
|
||||
return new PropertyPathInformation(path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getRootParentType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getRootParentType() {
|
||||
return path.getOwningType().getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getLeafType() {
|
||||
return path.getLeafProperty().getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafParentType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getLeafParentType() {
|
||||
return path.getLeafProperty().getOwningType().getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafProperty()
|
||||
*/
|
||||
@Override
|
||||
public String getLeafProperty() {
|
||||
return path.getLeafProperty().getSegment();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafPropertyDescriptor()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public PropertyDescriptor getLeafPropertyDescriptor() {
|
||||
return BeanUtils.getPropertyDescriptor(getLeafParentType(), getLeafProperty());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#toDotPath()
|
||||
*/
|
||||
@Override
|
||||
public String toDotPath() {
|
||||
return path.toDotPath();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#reifyPath(org.springframework.data.querydsl.EntityPathResolver)
|
||||
*/
|
||||
@Override
|
||||
public Path<?> reifyPath(EntityPathResolver resolver) {
|
||||
return reifyPath(resolver, path, null);
|
||||
@@ -147,10 +119,6 @@ record PropertyPathInformation(PropertyPath path) implements PathInformation {
|
||||
return (Path<?>) value;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -166,10 +134,6 @@ record PropertyPathInformation(PropertyPath path) implements PathInformation {
|
||||
&& ObjectUtils.nullSafeEquals(toDotPath(), that.toDotPath());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(getRootParentType());
|
||||
@@ -177,10 +141,6 @@ record PropertyPathInformation(PropertyPath path) implements PathInformation {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PropertyPathInformation(path=" + this.path + ")";
|
||||
|
||||
@@ -476,10 +476,6 @@ public class QuerydslBindings {
|
||||
registerBinding(PathAndBinding.withPath(path));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.QuerydslBindings.PathBinder#registerBinding(org.springframework.data.querydsl.binding.QuerydslBindings.PathAndBinding)
|
||||
*/
|
||||
@Override
|
||||
protected void registerBinding(PathAndBinding<P, T> binding) {
|
||||
|
||||
@@ -575,10 +571,6 @@ public class QuerydslBindings {
|
||||
return this.binding;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
@@ -593,10 +585,6 @@ public class QuerydslBindings {
|
||||
return ObjectUtils.nullSafeEquals(binding, that.binding);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(path);
|
||||
@@ -604,10 +592,6 @@ public class QuerydslBindings {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QuerydslBindings.PathAndBinding(path=" + this.getPath() + ", binding=" + this.getBinding() + ")";
|
||||
|
||||
@@ -68,10 +68,6 @@ public class QuerydslBindingsFactory implements ApplicationContextAware {
|
||||
this.defaultCustomizer = NoOpCustomizer.INSTANCE;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
|
||||
|
||||
@@ -42,10 +42,6 @@ import com.querydsl.core.types.dsl.SimpleExpression;
|
||||
*/
|
||||
class QuerydslDefaultBinding implements MultiValueBinding<Path<? extends Object>, Object> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.web.querydsl.QueryDslPredicateBuilder#buildPredicate(org.springframework.data.mapping.PropertyPath, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public Optional<Predicate> bind(Path<?> path, Collection<? extends Object> value) {
|
||||
|
||||
@@ -44,28 +44,16 @@ class QuerydslPathInformation implements PathInformation {
|
||||
return new QuerydslPathInformation(path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getRootParentType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getRootParentType() {
|
||||
return path.getRoot().getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getLeafType() {
|
||||
return path.getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafParentType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getLeafParentType() {
|
||||
|
||||
@@ -78,46 +66,26 @@ class QuerydslPathInformation implements PathInformation {
|
||||
return parent.getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafProperty()
|
||||
*/
|
||||
@Override
|
||||
public String getLeafProperty() {
|
||||
return path.getMetadata().getElement().toString();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafPropertyDescriptor()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public PropertyDescriptor getLeafPropertyDescriptor() {
|
||||
return BeanUtils.getPropertyDescriptor(getLeafParentType(), getLeafProperty());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#toDotPath()
|
||||
*/
|
||||
@Override
|
||||
public String toDotPath() {
|
||||
return QuerydslUtils.toDotPath(path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#reifyPath(org.springframework.data.querydsl.EntityPathResolver)
|
||||
*/
|
||||
public Path<?> reifyPath(EntityPathResolver resolver) {
|
||||
return path;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -133,10 +101,6 @@ class QuerydslPathInformation implements PathInformation {
|
||||
&& ObjectUtils.nullSafeEquals(toDotPath(), that.toDotPath());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(getRootParentType());
|
||||
@@ -144,10 +108,6 @@ class QuerydslPathInformation implements PathInformation {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QuerydslPathInformation(path=" + this.path + ")";
|
||||
|
||||
@@ -153,10 +153,6 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
|
||||
return StringUtils.collectionToDelimitedString(qualifierNames, ":") + ":" + repositoryType.getName();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.inject.spi.Bean#getTypes()
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public Set<Type> getTypes() {
|
||||
|
||||
@@ -202,10 +198,6 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
|
||||
create(beanManager.createCreationalContext(this));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.context.spi.Contextual#create(jakarta.enterprise.context.spi.CreationalContext)
|
||||
*/
|
||||
public final T create(@SuppressWarnings("null") CreationalContext<T> creationalContext) {
|
||||
|
||||
var repoInstance = this.repoInstance;
|
||||
@@ -222,10 +214,6 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
|
||||
return repoInstance;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.context.spi.Contextual#destroy(java.lang.Object, jakarta.enterprise.context.spi.CreationalContext)
|
||||
*/
|
||||
public void destroy(@SuppressWarnings("null") T instance,
|
||||
@SuppressWarnings("null") CreationalContext<T> creationalContext) {
|
||||
|
||||
@@ -237,26 +225,14 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
|
||||
creationalContext.release();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.inject.spi.Bean#getQualifiers()
|
||||
*/
|
||||
public Set<Annotation> getQualifiers() {
|
||||
return qualifiers;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.inject.spi.Bean#getName()
|
||||
*/
|
||||
public String getName() {
|
||||
return repositoryType.getName();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.inject.spi.Bean#getStereotypes()
|
||||
*/
|
||||
public Set<Class<? extends Annotation>> getStereotypes() {
|
||||
|
||||
return Arrays.stream(repositoryType.getAnnotations())//
|
||||
@@ -265,50 +241,26 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.inject.spi.Bean#getBeanClass()
|
||||
*/
|
||||
public Class<?> getBeanClass() {
|
||||
return repositoryType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.inject.spi.Bean#isAlternative()
|
||||
*/
|
||||
public boolean isAlternative() {
|
||||
return isAnnotatedWith(repositoryType, Alternative.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.inject.spi.Bean#isNullable()
|
||||
*/
|
||||
public boolean isNullable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.inject.spi.Bean#getInjectionPoints()
|
||||
*/
|
||||
public Set<InjectionPoint> getInjectionPoints() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.inject.spi.Bean#getScope()
|
||||
*/
|
||||
public Class<? extends Annotation> getScope() {
|
||||
return ApplicationScoped.class;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see jakarta.enterprise.inject.spi.PassivationCapable#getId()
|
||||
*/
|
||||
public String getId() {
|
||||
return passivationId;
|
||||
}
|
||||
@@ -484,10 +436,6 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
|
||||
return qualifiers.toArray(new Annotation[0]);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("CdiRepositoryBean: type='%s', qualifiers=%s", repositoryType.getName(),
|
||||
|
||||
@@ -170,28 +170,16 @@ public class CdiRepositoryContext {
|
||||
this.metadataReaderFactory = metadataReaderFactory;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.CustomRepositoryImplementationDetector.ImplementationDetectionConfiguration#getImplementationPostfix()
|
||||
*/
|
||||
@Override
|
||||
public String getImplementationPostfix() {
|
||||
return configuration.getRepositoryImplementationPostfix();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.CustomRepositoryImplementationDetector.ImplementationDetectionConfiguration#getBasePackages()
|
||||
*/
|
||||
@Override
|
||||
public Streamable<String> getBasePackages() {
|
||||
return Streamable.empty();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.CustomRepositoryImplementationDetector.ImplementationDetectionConfiguration#getExcludeFilters()
|
||||
*/
|
||||
@Override
|
||||
public Streamable<TypeFilter> getExcludeFilters() {
|
||||
return Streamable.empty();
|
||||
|
||||
@@ -127,10 +127,6 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura
|
||||
this.hasExplicitFilters = hasExplicitFilters(attributes);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getBasePackages()
|
||||
*/
|
||||
public Streamable<String> getBasePackages() {
|
||||
|
||||
var value = attributes.getStringArray("value");
|
||||
@@ -155,70 +151,38 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura
|
||||
return Streamable.of(packages);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getQueryLookupStrategyKey()
|
||||
*/
|
||||
public Optional<Object> getQueryLookupStrategyKey() {
|
||||
return Optional.ofNullable(attributes.get(QUERY_LOOKUP_STRATEGY));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getNamedQueryLocation()
|
||||
*/
|
||||
public Optional<String> getNamedQueryLocation() {
|
||||
return getNullDefaultedAttribute(NAMED_QUERIES_LOCATION);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getRepositoryImplementationPostfix()
|
||||
*/
|
||||
public Optional<String> getRepositoryImplementationPostfix() {
|
||||
return getNullDefaultedAttribute(REPOSITORY_IMPLEMENTATION_POSTFIX);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getSource()
|
||||
*/
|
||||
@NonNull
|
||||
public Object getSource() {
|
||||
return configMetadata;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSourceSupport#getIncludeFilters()
|
||||
*/
|
||||
@Override
|
||||
protected Iterable<TypeFilter> getIncludeFilters() {
|
||||
return parseFilters("includeFilters");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSourceSupport#getExcludeFilters()
|
||||
*/
|
||||
@Override
|
||||
public Streamable<TypeFilter> getExcludeFilters() {
|
||||
return parseFilters("excludeFilters");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getRepositoryFactoryBeanClassName()
|
||||
*/
|
||||
@Override
|
||||
public Optional<String> getRepositoryFactoryBeanClassName() {
|
||||
return Optional.of(attributes.getClass(REPOSITORY_FACTORY_BEAN_CLASS).getName());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getRepositoryBaseClassName()
|
||||
*/
|
||||
@Override
|
||||
public Optional<String> getRepositoryBaseClassName() {
|
||||
|
||||
@@ -249,28 +213,16 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura
|
||||
return enableAnnotationMetadata;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSourceSupport#shouldConsiderNestedRepositories()
|
||||
*/
|
||||
@Override
|
||||
public boolean shouldConsiderNestedRepositories() {
|
||||
return attributes.containsKey(CONSIDER_NESTED_REPOSITORIES) && attributes.getBoolean(CONSIDER_NESTED_REPOSITORIES);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getAttribute(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Optional<String> getAttribute(String name) {
|
||||
return getAttribute(name, String.class);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getAttribute(java.lang.String, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Optional<T> getAttribute(String name, Class<T> type) {
|
||||
|
||||
@@ -295,19 +247,11 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura
|
||||
return Optional.ofNullable(type.cast(result));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#usesExplicitFilters()
|
||||
*/
|
||||
@Override
|
||||
public boolean usesExplicitFilters() {
|
||||
return hasExplicitFilters;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getBootstrapMode()
|
||||
*/
|
||||
@Override
|
||||
public BootstrapMode getBootstrapMode() {
|
||||
|
||||
@@ -318,10 +262,6 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.RepositoryConfigurationSource#getResourceDescription()
|
||||
*/
|
||||
@Override
|
||||
public String getResourceDescription() {
|
||||
|
||||
|
||||
@@ -60,64 +60,36 @@ class DefaultImplementationLookupConfiguration implements ImplementationLookupCo
|
||||
.decapitalize(ClassUtils.getShortName(interfaceName).concat(config.getImplementationPostfix()));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.ImplementationLookupConfiguration#getImplementationBeanName()
|
||||
*/
|
||||
@Override
|
||||
public String getImplementationBeanName() {
|
||||
return beanName;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.ImplementationDetectionConfiguration#getImplementationPostfix()
|
||||
*/
|
||||
@Override
|
||||
public String getImplementationPostfix() {
|
||||
return config.getImplementationPostfix();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.ImplementationDetectionConfiguration#getExcludeFilters()
|
||||
*/
|
||||
@Override
|
||||
public Streamable<TypeFilter> getExcludeFilters() {
|
||||
return config.getExcludeFilters().and(new AnnotationTypeFilter(NoRepositoryBean.class));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.ImplementationDetectionConfiguration#getMetadataReaderFactory()
|
||||
*/
|
||||
@Override
|
||||
public MetadataReaderFactory getMetadataReaderFactory() {
|
||||
return config.getMetadataReaderFactory();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.ImplementationDetectionConfiguration#getBasePackages()
|
||||
*/
|
||||
@Override
|
||||
public Streamable<String> getBasePackages() {
|
||||
return Streamable.of(ClassUtils.getPackageName(interfaceName));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.ImplementationLookupConfiguration#getImplementationClassName()
|
||||
*/
|
||||
@Override
|
||||
public String getImplementationClassName() {
|
||||
return getLocalName(interfaceName).concat(getImplementationPostfix());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.ImplementationLookupConfiguration#hasMatchingBeanName(org.springframework.beans.factory.config.BeanDefinition)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasMatchingBeanName(BeanDefinition definition) {
|
||||
|
||||
@@ -126,10 +98,6 @@ class DefaultImplementationLookupConfiguration implements ImplementationLookupCo
|
||||
return beanName != null && beanName.equals(config.generateBeanName(definition));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.config.ImplementationLookupConfiguration#matches(org.springframework.beans.factory.config.BeanDefinition, org.springframework.core.type.classreading.MetadataReaderFactory)
|
||||
*/
|
||||
@Override
|
||||
public boolean matches(BeanDefinition definition) {
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user