Moved MappingConfigurationBuilder functionality into BasicMappingContext. Got rid of obsolete methods in MappingContext, PersistentEntity and PersistentProperty to minimize the API exposed.
Re-added a initialEntitySet property to BasicMappingContext and let trigger adding those to the context in afterPropertiesSet(). Moved createPersistentEntity and createPersistentProperty methods from MappingConfigurationBuilder into BasicMappingContext (could probably be done for all of those methods still in MCB).
Opened up getPersistentEntites() in MappingContext interface to return Collection<? extends PersistentEntity> to allow easy overriding in subclasses with more specific types.
The added custom simple types will be considered in the decision whether to recursively add PersistentEntities. This does not feel quite right for now as for a complete setup we now have to register converters in the MappingMongoConverter *and* add the custom type to the list here. Open for discussion.
Fixed isAssignableFrom(…) usage in BasicPersistentProperty to correctly detect collections and maps. Let MappingBeanHelper treat enums as simple types as well.
Added TypeInformation interface and infrastructure to discover generic types given a basic type that binds generic types. Starting from that you can then traverse TypeInformations for fields by calling getProperty(…). A subsequent call to getType() will then return the resolved type.
Adapted the Basic mapping infrastructure to accomodate the TypeInformation interfaces where necessary. In most cases it was just about using TypeInformation instead of class as we have to keep track of the parent types that (in case of a generic field) determine the actual type of sub fields. BasicMappingContext is now using the TypeInformation instance created for PersistentEntity as key for the cache. This is necessary as generic types (e.g. Foo<T>) might be used inside different entities that type T to something different.
Created isMap() and isArray() on PersistentProperty to align to isCollection().
The PersistentProperty interface now has a isIdPropertyMethod(). Subclasses might alter it to support further id property detection mechanisms. Added missing import in BasicPersistentProperty.
Spring already contains functionality to to something with all fields of
a class including all fields from superclasses. Refactored the field
collecting code to use this.