private int getTypeIndex(List<TypeInformation<?>> parameterTypes, Class<?> type, @Nullable Class<?> componentType) { for (int i = 0; i < parameterTypes.size(); i++) { TypeInformation<?> candidate = parameterTypes.get(i); if (candidate.getType().equals(type)) { if (componentType == null) { return i; } else if (componentType.equals(candidate.getRequiredComponentType().getType())) { return i; } } } return -1; }
private boolean isGeoNearQuery(Method method) { Class<?> returnType = method.getReturnType(); for (Class<?> type : GEO_NEAR_RESULTS) { if (type.isAssignableFrom(returnType)) { return true; } } if (Iterable.class.isAssignableFrom(returnType)) { TypeInformation<?> from = ClassTypeInformation.fromReturnTypeOf(method); return GeoResult.class.equals(from.getRequiredComponentType().getType()); } return false; }
private boolean isGeoNearQuery(Method method) { if (ReactiveWrappers.supports(method.getReturnType())) { TypeInformation<?> from = ClassTypeInformation.fromReturnTypeOf(method); return GeoResult.class.equals(from.getRequiredComponentType().getType()); } return false; }
public ReactiveElasticsearchQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory, MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext) { super(method, metadata, factory, mappingContext); this.method = method; if (hasParameterOfType(method, Pageable.class)) { TypeInformation<?> returnType = ClassTypeInformation.fromReturnTypeOf(method); boolean multiWrapper = ReactiveWrappers.isMultiValueType(returnType.getType()); boolean singleWrapperWithWrappedPageableResult = ReactiveWrappers.isSingleValueType(returnType.getType()) && (PAGE_TYPE.isAssignableFrom(returnType.getRequiredComponentType()) || SLICE_TYPE.isAssignableFrom(returnType.getRequiredComponentType())); if (singleWrapperWithWrappedPageableResult) { throw new InvalidDataAccessApiUsageException( String.format("'%s.%s' must not use sliced or paged execution. Please use Flux.buffer(size, skip).", ClassUtils.getShortName(method.getDeclaringClass()), method.getName())); } if (!multiWrapper) { throw new IllegalStateException(String.format( "Method has to use a either multi-item reactive wrapper return type or a wrapped Page/Slice type. Offending method: %s", method.toString())); } if (hasParameterOfType(method, Sort.class)) { throw new IllegalStateException(String.format("Method must not have Pageable *and* Sort parameter. " + "Use sorting capabilities on Pageble instead! Offending method: %s", method.toString())); } } }
&& (PAGE_TYPE.isAssignableFrom(returnType.getRequiredComponentType()) || SLICE_TYPE.isAssignableFrom(returnType.getRequiredComponentType()));
persistentProperty.getTypeInformation().getRequiredComponentType(), sink); } else { persistentProperty.getTypeInformation().getRequiredComponentType(), sink); } else if (propertyValue.getClass().isArray()) { persistentProperty.getTypeInformation().getRequiredComponentType(), sink); } else {
typeInformation.getRequiredComponentType().getType(), mapValueType, source); typeInformation.getRequiredComponentType().getType(), mapValueType, source); typeInformation.getRequiredComponentType().getActualType().getType(), source.getBucket());
private int getTypeIndex(List<TypeInformation<?>> parameterTypes, Class<?> type, @Nullable Class<?> componentType) { for (int i = 0; i < parameterTypes.size(); i++) { TypeInformation<?> candidate = parameterTypes.get(i); if (candidate.getType().equals(type)) { if (componentType == null) { return i; } else if (componentType.equals(candidate.getRequiredComponentType().getType())) { return i; } } } return -1; }
private boolean isGeoNearQuery(Method method) { Class<?> returnType = method.getReturnType(); for (Class<?> type : GEO_NEAR_RESULTS) { if (type.isAssignableFrom(returnType)) { return true; } } if (Iterable.class.isAssignableFrom(returnType)) { TypeInformation<?> from = ClassTypeInformation.fromReturnTypeOf(method); return GeoResult.class.equals(from.getRequiredComponentType().getType()); } return false; }
association.getInverse().getTypeInformation().getRequiredComponentType().getActualType());
private boolean isGeoNearQuery(Method method) { if (ReactiveWrappers.supports(method.getReturnType())) { TypeInformation<?> from = ClassTypeInformation.fromReturnTypeOf(method); return GeoResult.class.equals(from.getRequiredComponentType().getType()); } return false; }
.getInverse().getTypeInformation().getRequiredComponentType().getActualType());
&& (PAGE_TYPE.isAssignableFrom(returnType.getRequiredComponentType()) || SLICE_TYPE.isAssignableFrom(returnType.getRequiredComponentType()));
@Override public Class<?> getReturnedDomainClass(final Method method) { if (ArangoCursor.class.isAssignableFrom(method.getReturnType())) { return typeInformation.getReturnType(method).getRequiredComponentType().getType(); } else { return super.getReturnedDomainClass(method); } }
@Override public Class<?> getReturnedDomainClass(final Method method) { if (ArangoCursor.class.isAssignableFrom(method.getReturnType())) { return typeInformation.getReturnType(method).getRequiredComponentType().getType(); } else { return super.getReturnedDomainClass(method); } }
@Override public Class<?> getReturnedDomainClass(final Method method) { if (ArangoCursor.class.isAssignableFrom(method.getReturnType())) { return typeInformation.getReturnType(method).getRequiredComponentType().getType(); } else { return super.getReturnedDomainClass(method); } }
private Object writeMapInternal(Map<Object, Object> source, TypeInformation<?> type) { Map<Object, Object> converted = CollectionFactory.createMap(type.getType(), source.size()); TypeInformation<?> keyType = type.getRequiredComponentType(); TypeInformation<?> valueType = type.getRequiredMapValueType(); for (Entry<Object, Object> entry : source.entrySet()) { converted.put(convertToColumnType(entry.getKey(), keyType), convertToColumnType(entry.getValue(), valueType)); } return converted; }
private static TypeInformation<?> getEffectivelyReturnedTypeFrom(Method method) { TypeInformation<?> returnType = ClassTypeInformation.fromReturnTypeOf(method); return QueryExecutionConverters.supports(returnType.getType()) ? returnType.getRequiredComponentType() : returnType; } }
private Class columnTypeForReference() { Class<?> componentType = getTypeInformation().getRequiredComponentType().getType(); RelationalPersistentEntity<?> referencedEntity = context.getRequiredPersistentEntity(componentType); return referencedEntity.getRequiredIdProperty().getColumnType(); }
private Class columnTypeForReference() { Class<?> componentType = getTypeInformation().getRequiredComponentType().getType(); RelationalPersistentEntity<?> referencedEntity = context.getRequiredPersistentEntity(componentType); return referencedEntity.getRequiredIdProperty().getColumnType(); }