Java Code Examples for org.springframework.data.util.TypeInformation

The following examples show how to use org.springframework.data.util.TypeInformation. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: sdn-rx   Source File: ReactiveNeo4jQueryMethod.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link ReactiveNeo4jQueryMethod} from the given parameters.
 *
 * @param method   must not be {@literal null}.
 * @param metadata must not be {@literal null}.
 * @param factory  must not be {@literal null}.
 */
ReactiveNeo4jQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory) {
	super(method, metadata, factory);

	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 multi-item reactive wrapper return type. Offending method: %s",
				method.toString()));
		}
	}
}
 
Example 2
@Nullable
private TypeInformation<?> detectAssociationTargetType() {

	if (!isAssociation()) {
		return null;
	}

	for (Class<? extends Annotation> annotationType : ASSOCIATION_ANNOTATIONS) {

		Annotation annotation = findAnnotation(annotationType);

		if (annotation == null) {
			continue;
		}

		Object entityValue = AnnotationUtils.getValue(annotation, "targetEntity");

		if (entityValue == null || entityValue.equals(void.class)) {
			continue;
		}

		return ClassTypeInformation.from((Class<?>) entityValue);
	}

	return null;
}
 
Example 3
Source Project: spring-data   Source File: DefaultArangoPersistentEntity.java    License: Apache License 2.0 6 votes vote down vote up
public DefaultArangoPersistentEntity(final TypeInformation<T> information) {
	super(information);
	collection = StringUtils.uncapitalize(information.getType().getSimpleName());
	context = new StandardEvaluationContext();
	hashIndexedProperties = new ArrayList<>();
	skiplistIndexedProperties = new ArrayList<>();
	persistentIndexedProperties = new ArrayList<>();
	geoIndexedProperties = new ArrayList<>();
	fulltextIndexedProperties = new ArrayList<>();
	repeatableAnnotationCache = new HashMap<>();
	final Document document = findAnnotation(Document.class);
	final Edge edge = findAnnotation(Edge.class);
	if (edge != null) {
		collection = StringUtils.hasText(edge.value()) ? edge.value() : collection;
		collectionOptions = createCollectionOptions(edge);
	} else if (document != null) {
		collection = StringUtils.hasText(document.value()) ? document.value() : collection;
		collectionOptions = createCollectionOptions(document);
	} else {
		collectionOptions = new CollectionCreateOptions().type(CollectionType.DOCUMENT);
	}
	expression = PARSER.parseExpression(collection, ParserContext.TEMPLATE_EXPRESSION);
}
 
Example 4
Source Project: spring-data   Source File: DefaultArangoConverter.java    License: Apache License 2.0 6 votes vote down vote up
private Object readMap(final TypeInformation<?> type, final VPackSlice source) {
	if (!source.isObject()) {
		throw new MappingException(
				String.format("Can't read map type %s from VPack type %s!", type, source.getType()));
	}

	final Class<?> keyType = getNonNullComponentType(type).getType();
	final TypeInformation<?> valueType = getNonNullMapValueType(type);
	final Map<Object, Object> map = CollectionFactory.createMap(type.getType(), keyType, source.size());

	final Iterator<Entry<String, VPackSlice>> iterator = source.objectIterator();

	while (iterator.hasNext()) {
		final Entry<String, VPackSlice> entry = iterator.next();
		if (typeMapper.isTypeKey(entry.getKey())) {
			continue;
		}

		final Object key = convertIfNecessary(entry.getKey(), keyType);
		final VPackSlice value = entry.getValue();

		map.put(key, readInternal(valueType, value));
	}

	return map;
}
 
Example 5
Source Project: spring-data   Source File: DefaultArangoConverter.java    License: Apache License 2.0 6 votes vote down vote up
private Object readCollection(final TypeInformation<?> type, final VPackSlice source) {
	if (!source.isArray()) {
		throw new MappingException(
				String.format("Can't read collection type %s from VPack type %s!", type, source.getType()));
	}

	final TypeInformation<?> componentType = getNonNullComponentType(type);
	final Class<?> collectionType = Iterable.class.equals(type.getType()) ? Collection.class : type.getType();
	final Collection<Object> collection = CollectionFactory.createCollection(collectionType,
		componentType.getType(), source.getLength());

	final Iterator<VPackSlice> iterator = source.arrayIterator();

	while (iterator.hasNext()) {
		final VPackSlice elem = iterator.next();
		collection.add(readInternal(componentType, elem));
	}

	return collection;
}
 
Example 6
Source Project: spring-data   Source File: DefaultArangoConverter.java    License: Apache License 2.0 6 votes vote down vote up
private Object readArray(final TypeInformation<?> type, final VPackSlice source) {
	if (!source.isArray()) {
		throw new MappingException(
				String.format("Can't read array type %s from VPack type %s!", type, source.getType()));
	}

	final TypeInformation<?> componentType = getNonNullComponentType(type);
	final int length = source.getLength();
	final Object array = Array.newInstance(componentType.getType(), length);

	for (int i = 0; i < length; ++i) {
		Array.set(array, i, readInternal(componentType, source.get(i)));
	}

	return array;
}
 
Example 7
Source Project: spring-data   Source File: DefaultArangoConverter.java    License: Apache License 2.0 6 votes vote down vote up
private void writeArray(
	final String attribute,
	final Object source,
	final VPackBuilder sink,
	final TypeInformation<?> definedType) {

	if (byte[].class.equals(source.getClass())) {
		sink.add(attribute, Base64Utils.encodeToString((byte[]) source));
	}

	else {
		sink.add(attribute, ValueType.ARRAY);
		for (int i = 0; i < Array.getLength(source); ++i) {
			final Object element = Array.get(source, i);
			writeInternal(null, element, sink, getNonNullComponentType(definedType));
		}
		sink.close();
	}
}
 
Example 8
private static TypeInformation<?> detectDomainType(TypeInformation<?> source) {

		if (source.getTypeArguments().isEmpty()) {
			return source;
		}

		TypeInformation<?> actualType = source.getActualType();

		if (source != actualType) {
			return detectDomainType(actualType);
		}

		if (source instanceof Iterable) {
			return source;
		}

		return detectDomainType(source.getComponentType());
	}
 
Example 9
Source Project: spring-data-crate   Source File: EntityColumnMapper.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @param properties properties of array/collection types, must not be {@literal null}.
 * @return list of columns of crate type array
 * @throws {@link InvalidCrateApiUsageException}
 */
public List<Column> mapColumns(Set<CratePersistentProperty> properties) {
	
	List<Column> columns = new LinkedList<>();
	
	for(CratePersistentProperty property : properties) {
		
		TypeInformation<?> typeInformation = from(property.getComponentType());
		// safety check
		if(property.isCollectionLike() && typeInformation.isMap()) {
			
			// could be a list or an array
			TypeInformation<?> actualType = property.getTypeInformation().getActualType();					
			// get the map's key type
			Class<?> componentType = actualType.getTypeArguments().get(0).getType();					
			
			checkMapKey(componentType);
			
			columns.add(createColumn(property));
		}
	}
	
	return columns;
}
 
Example 10
/**
 * Obtains the domain type information from the given method parameter. Will
 * favor an explicitly registered on through
 * {@link QuerydslPredicate#root()} but use the actual type of the method's
 * return type as fallback.
 * 
 * @param parameter
 *            must not be {@literal null}.
 * @return
 */
static TypeInformation<?> extractTypeInfo(MethodParameter parameter) {

	QuerydslPredicate annotation = parameter.getParameterAnnotation(QuerydslPredicate.class);

	if (annotation != null && !Object.class.equals(annotation.root())) {
		return ClassTypeInformation.from(annotation.root());
	}

	Class<?> containingClass = parameter.getContainingClass();
	if (ClassUtils.isAssignable(EntityController.class, containingClass)) {
		ResolvableType resolvableType = ResolvableType.forClass(containingClass);
		return ClassTypeInformation.from(resolvableType.as(EntityController.class).getGeneric(0).resolve());
	}

	return detectDomainType(ClassTypeInformation.fromReturnTypeOf(parameter.getMethod()));
}
 
Example 11
Source Project: spring-vault   Source File: BasicVaultPersistentEntity.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates new {@link BasicVaultPersistentEntity}.
 * @param information must not be {@literal null}.
 * @param fallbackKeySpaceResolver can be {@literal null}.
 */
public BasicVaultPersistentEntity(TypeInformation<T> information, KeySpaceResolver fallbackKeySpaceResolver) {
	super(information, fallbackKeySpaceResolver);

	Secret annotation = findAnnotation(Secret.class);

	if (annotation != null && StringUtils.hasText(annotation.backend())) {

		this.backend = annotation.backend();
		this.backendExpression = detectExpression(this.backend);

	}
	else {
		this.backend = "secret";
		this.backendExpression = null;
	}
}
 
Example 12
/**
 * Constructor.
 * @param information type information about the underlying entity type.
 * @param datastoreMappingContext a mapping context used to get metadata for related
 *     persistent entities.
 */
public DatastorePersistentEntityImpl(TypeInformation<T> information,
		DatastoreMappingContext datastoreMappingContext) {
	super(information);

	Class<?> rawType = information.getType();

	this.datastoreMappingContext = datastoreMappingContext;
	this.context = new StandardEvaluationContext();
	this.kind = findAnnotation(Entity.class);
	this.discriminatorField = findAnnotation(DiscriminatorField.class);
	this.discriminatorValue = findAnnotation(DiscriminatorValue.class);
	this.classBasedKindName = this.hasTableName() ? this.kind.name()
			: StringUtils.uncapitalize(rawType.getSimpleName());
	this.kindNameExpression = detectExpression();
}
 
Example 13
Source Project: spring-data   Source File: AbstractResolver.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
protected Object proxy(
	final String id,
	final TypeInformation<?> type,
	final A annotation,
	final ResolverCallback<A> callback) {
	final ProxyInterceptor interceptor = new ProxyInterceptor(id, type, annotation, callback, conversionService);
	if (type.getType().isInterface()) {
		final ProxyFactory proxyFactory = new ProxyFactory(new Class<?>[] { type.getType() });
		for (final Class<?> interf : type.getType().getInterfaces()) {
			proxyFactory.addInterface(interf);
		}
		proxyFactory.addInterface(LazyLoadingProxy.class);
		proxyFactory.addAdvice(interceptor);
		return proxyFactory.getProxy();
	} else {
		final Factory factory = (Factory) objenesis.newInstance(enhancedTypeFor(type.getType()));
		factory.setCallbacks(new Callback[] { interceptor });
		return factory;
	}
}
 
Example 14
Source Project: spring-data-crate   Source File: CrateDocumentConverter.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Nesting Array or Collection types is not supported by crate. It is safe to assume that the payload
 * will contain either a Map or a primitive type. Map types will be converted to {@link CrateDocument}
 * while simple types will be added without any conversion
 * @param array {@link CrateArray} for adding either Map or Simple types
 * @param payload containing either a Map or primitive type.
 */
@SuppressWarnings("unchecked")
private void toCrateArray(CrateArray array, Object payload) {
	
	Collection<Object> objects = (Collection<Object>)(payload.getClass().isArray() ? asList((Object[])payload) : payload);
	
	for(Object object : objects) {
		
		TypeInformation<?> type = getTypeInformation(object.getClass());
		
		if(type.isMap()) {
			CrateDocument document = new CrateDocument();
			toCrateDocument(document, object);
			array.add(document);
		}else {
			array.add(object);
		}
	}
}
 
Example 15
Source Project: spring-data-crate   Source File: MappingCrateConverter.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void write(Object source, CrateDocument sink) {

	if(source == null) {
		return;
	}

	TypeInformation<?> type = from(source.getClass());

	if(!conversions.hasCustomWriteTarget(source.getClass(), sink.getClass())) {
		typeMapper.writeType(type, sink);
	}

	writeInternal(source, sink, type);
}
 
Example 16
Source Project: sdn-rx   Source File: DefaultNeo4jPersistentEntity.java    License: Apache License 2.0 5 votes vote down vote up
DefaultNeo4jPersistentEntity(TypeInformation<T> information) {
	super(information);

	this.isExplicitEntity = this.isAnnotationPresent(Node.class);
	this.primaryLabel = computePrimaryLabel();
	this.additionalLabels = Lazy.of(this::computeAdditionalLabels);
	this.graphProperties = Lazy.of(this::computeGraphProperties);
	this.dynamicLabelsProperty = Lazy
		.of(() -> getGraphProperties().stream().map(Neo4jPersistentProperty.class::cast)
			.filter(Neo4jPersistentProperty::isDynamicLabels).findFirst().orElse(null));
}
 
Example 17
Source Project: spring-vault   Source File: MappingVaultConverter.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private <S> S read(TypeInformation<S> type, Object source) {

	SecretDocument secretDocument = getSecretDocument(source);

	TypeInformation<? extends S> typeToUse = secretDocument != null
			? this.typeMapper.readType(secretDocument.getBody(), type)
			: (TypeInformation) ClassTypeInformation.OBJECT;
	Class<? extends S> rawType = typeToUse.getType();

	if (this.conversions.hasCustomReadTarget(source.getClass(), rawType)) {
		return this.conversionService.convert(source, rawType);
	}

	if (SecretDocument.class.isAssignableFrom(rawType)) {
		return (S) source;
	}

	if (Map.class.isAssignableFrom(rawType) && secretDocument != null) {
		return (S) secretDocument.getBody();
	}

	if (typeToUse.isMap() && secretDocument != null) {
		return (S) readMap(typeToUse, secretDocument.getBody());
	}

	if (typeToUse.equals(ClassTypeInformation.OBJECT)) {
		return (S) source;
	}

	return read((VaultPersistentEntity<S>) this.mappingContext.getRequiredPersistentEntity(typeToUse),
			secretDocument);
}
 
Example 18
Source Project: flow-platform-x   Source File: FlowMappingContext.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected <T> BasicMongoPersistentEntity<T> createPersistentEntity(TypeInformation<T> typeInformation) {
    String collection = collectionMapping.get(typeInformation);
    if (Objects.isNull(collection)) {
        return super.createPersistentEntity(typeInformation);
    }

    BasicMongoPersistentEntity<T> entity = new FlowPersistentEntity<>(typeInformation, collection);
    if (context != null) {
        entity.setApplicationContext(context);
    }

    return entity;
}
 
Example 19
Source Project: spring-data-crate   Source File: MappingCrateConverter.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Read a collection from the source object.
 *
 * @param targetType the target type.
 * @param source the list as source.
 * @param parent the optional parent.
 * @return the converted {@link Collection} or array, will never be {@literal null}.
 */
private Object readCollection(final TypeInformation<?> targetType, final CrateArray source, final Object parent) {
	
	notNull(targetType);

    Class<?> collectionType = targetType.getType();
    
    if(source.isEmpty()) {
      return getPotentiallyConvertedSimpleRead(new HashSet<Object>(), collectionType);
    }

    collectionType = Collection.class.isAssignableFrom(collectionType) ? collectionType : List.class;
    
    Collection<Object> items = targetType.getType().isArray() ? new ArrayList<Object>(source.size()) :
    															createCollection(collectionType, source.size());
    
    TypeInformation<?> componentType = targetType.getComponentType();
    
    Class<?> rawComponentType = componentType == null ? null : componentType.getType();

    for(Object object : source) {
    	if(object instanceof CrateDocument) {
    		items.add(read(componentType, (CrateDocument) object, parent));
    	}else {
    		items.add(getPotentiallyConvertedSimpleRead(object, rawComponentType));
    	}
    }
    
    return getPotentiallyConvertedSimpleRead(items, targetType.getType());
  }
 
Example 20
Source Project: spring-data   Source File: DefaultArangoConverter.java    License: Apache License 2.0 5 votes vote down vote up
private void writeProperty(final Object source, final VPackBuilder sink, final ArangoPersistentProperty property) {
	if (source == null) {
		return;
	}

	final TypeInformation<?> sourceType = ClassTypeInformation.from(source.getClass());
	final String fieldName = property.getFieldName();

	if (property.getRef().isPresent()) {
		if (sourceType.isCollectionLike()) {
			writeReferences(fieldName, source, sink);
		} else {
			writeReference(fieldName, source, sink);
		}
	}

	else if (property.getRelations().isPresent()) {
		// nothing to store
	}

	else if (property.getFrom().isPresent() || property.getTo().isPresent()) {
		if (!sourceType.isCollectionLike()) {
			writeReference(fieldName, source, sink);
		}
	}

	else {
		final Object entity = source instanceof LazyLoadingProxy ? ((LazyLoadingProxy) source).getEntity() : source;
		writeInternal(fieldName, entity, sink, property.getTypeInformation());
	}
}
 
Example 21
Source Project: spring-data   Source File: DefaultArangoConverter.java    License: Apache License 2.0 5 votes vote down vote up
private void writeCollection(
	final String attribute,
	final Object source,
	final VPackBuilder sink,
	final TypeInformation<?> definedType) {

	sink.add(attribute, ValueType.ARRAY);

	for (final Object entry : asCollection(source)) {
		writeInternal(null, entry, sink, getNonNullComponentType(definedType));
	}

	sink.close();
}
 
Example 22
Source Project: spring-data   Source File: DefaultArangoConverter.java    License: Apache License 2.0 5 votes vote down vote up
private void writeBaseDocument(
	final String attribute,
	final BaseDocument source,
	final VPackBuilder sink,
	final TypeInformation<?> definedType) {

	final VPackBuilder builder = new VPackBuilder();
	writeMap(attribute, source.getProperties(), builder, definedType);
	builder.add(_ID, source.getId());
	builder.add(_KEY, source.getKey());
	builder.add(_REV, source.getRevision());
	sink.add(attribute, builder.slice());
}
 
Example 23
Source Project: spring-data   Source File: DefaultArangoConverter.java    License: Apache License 2.0 5 votes vote down vote up
private void writeBaseEdgeDocument(
	final String attribute,
	final BaseEdgeDocument source,
	final VPackBuilder sink,
	final TypeInformation<?> definedType) {

	final VPackBuilder builder = new VPackBuilder();
	writeMap(attribute, source.getProperties(), builder, definedType);
	builder.add(_ID, source.getId());
	builder.add(_KEY, source.getKey());
	builder.add(_REV, source.getRevision());
	builder.add(_FROM, source.getFrom());
	builder.add(_TO, source.getTo());
	sink.add(attribute, builder.slice());
}
 
Example 24
private static <T> String getEntityCollectionName(TypeInformation<T> typeInformation) {
	Document document = AnnotationUtils.findAnnotation(typeInformation.getType(), Document.class);
	String collectionName = (String) AnnotationUtils.getValue(document, "collectionName");

	if (StringUtils.isEmpty(collectionName)) {
		// Infer the collection name as the uncapitalized document name.
		return StringUtils.uncapitalize(typeInformation.getType().getSimpleName());
	}
	else {
		return collectionName;
	}
}
 
Example 25
Source Project: spring-data   Source File: DefaultArangoTypeMapper.java    License: Apache License 2.0 5 votes vote down vote up
public void writeType(final TypeInformation<?> info, final VPackBuilder sink) {
	Assert.notNull(info, "TypeInformation must not be null!");

	final Alias alias = getAliasFor(info);
	if (alias.isPresent()) {
		accessor.writeTypeTo(sink, alias.getValue());
	}
}
 
Example 26
Source Project: spring-data   Source File: DefaultArangoTypeMapper.java    License: Apache License 2.0 5 votes vote down vote up
protected final Alias getAliasFor(final TypeInformation<?> info) {
	Assert.notNull(info, "TypeInformation must not be null!");
	
	for (final TypeInformationMapper mapper : mappers) {
		final Alias alias = mapper.createAliasFor(info);
		if (alias.isPresent()) {
			return alias;
		}
	}

	return Alias.NONE;
}
 
Example 27
Source Project: spring-data-crate   Source File: MappingCrateConverter.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Adds custom type information to the given {@link CrateDocument} if necessary.
 *  
 * @param type
 * @param value must not be {@literal null}.
 * @param document must not be {@literal null}.
 */
protected void addCustomTypeKeyIfNecessary(TypeInformation<?> type, Object value, CrateDocument document) {

	TypeInformation<?> actualType = type != null ? type.getActualType() : null;
	Class<?> reference = actualType == null ? Object.class : actualType.getType();
	Class<?> valueType = getUserClass(value.getClass());

	boolean notTheSameClass = !valueType.equals(reference);
	if(notTheSameClass) {
		typeMapper.writeType(valueType, document);
	}
}
 
Example 28
private SpannerMappingContext createSpannerMappingContextWith(
		SpannerPersistentEntityImpl mockEntity) {
	return new SpannerMappingContext() {
		@Override
		@SuppressWarnings("unchecked")
		protected  SpannerPersistentEntityImpl constructPersistentEntity(
				TypeInformation typeInformation) {
			return mockEntity;
		}
	};
}
 
Example 29
Source Project: spring-vault   Source File: MappingVaultConverter.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Reads the given {@link List} into a collection of the given {@link TypeInformation}
 * .
 * @param targetType must not be {@literal null}.
 * @param sourceValue must not be {@literal null}.
 * @return the converted {@link Collection} or array, will never be {@literal null}.
 */
@Nullable
@SuppressWarnings({ "rawtypes", "unchecked" })
private Object readCollectionOrArray(TypeInformation<?> targetType, List sourceValue) {

	Assert.notNull(targetType, "Target type must not be null");

	Class<?> collectionType = targetType.getType();

	TypeInformation<?> componentType = targetType.getComponentType() != null ? targetType.getComponentType()
			: ClassTypeInformation.OBJECT;
	Class<?> rawComponentType = componentType.getType();

	collectionType = Collection.class.isAssignableFrom(collectionType) ? collectionType : List.class;
	Collection<Object> items = targetType.getType().isArray() ? new ArrayList<>(sourceValue.size())
			: CollectionFactory.createCollection(collectionType, rawComponentType, sourceValue.size());

	if (sourceValue.isEmpty()) {
		return getPotentiallyConvertedSimpleRead(items, collectionType);
	}

	for (Object obj : sourceValue) {

		if (obj instanceof Map) {
			items.add(read(componentType, (Map) obj));
		}
		else if (obj instanceof List) {
			items.add(readCollectionOrArray(ClassTypeInformation.OBJECT, (List) obj));
		}
		else {
			items.add(getPotentiallyConvertedSimpleRead(obj, rawComponentType));
		}
	}

	return getPotentiallyConvertedSimpleRead(items, targetType.getType());
}
 
Example 30
Source Project: spring-cloud-gcp   Source File: TwoStepsConversions.java    License: Apache License 2.0 5 votes vote down vote up
private EntityValue convertOnWriteSingleEmbeddedMap(Object val, String kindName,
		TypeInformation valueTypeInformation) {
	return applyEntityValueBuilder(null, kindName, (builder) -> {
		Map map = (Map) val;
		for (Object key : map.keySet()) {
			String field = convertOnReadSingle(convertOnWriteSingle(key).get(),
					ClassTypeInformation.from(String.class));
			builder.set(field,
					convertOnWrite(map.get(key),
							EmbeddedType.of(valueTypeInformation),
							field, valueTypeInformation));
		}
	}, false);
}