|
|
|
@ -27,6 +27,7 @@ import org.springframework.core.convert.converter.ConditionalGenericConverter; |
|
|
|
import org.springframework.core.convert.converter.ConverterRegistry; |
|
|
|
import org.springframework.core.convert.converter.ConverterRegistry; |
|
|
|
import org.springframework.data.repository.CrudRepository; |
|
|
|
import org.springframework.data.repository.CrudRepository; |
|
|
|
import org.springframework.data.repository.core.RepositoryInformation; |
|
|
|
import org.springframework.data.repository.core.RepositoryInformation; |
|
|
|
|
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* {@link org.springframework.core.convert.converter.Converter} to convert arbitrary input into domain classes managed |
|
|
|
* {@link org.springframework.core.convert.converter.Converter} to convert arbitrary input into domain classes managed |
|
|
|
@ -60,6 +61,10 @@ public class DomainClassConverter<T extends ConversionService & ConverterRegistr |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { |
|
|
|
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (source == null || !StringUtils.hasText(source.toString())) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RepositoryInformation info = repositories.getRepositoryInformationFor(targetType.getType()); |
|
|
|
RepositoryInformation info = repositories.getRepositoryInformationFor(targetType.getType()); |
|
|
|
|
|
|
|
|
|
|
|
CrudRepository<?, Serializable> repository = repositories.getRepositoryFor(targetType.getType()); |
|
|
|
CrudRepository<?, Serializable> repository = repositories.getRepositoryFor(targetType.getType()); |
|
|
|
|