Commit Graph

27 Commits

Author SHA1 Message Date
Oliver Gierke
73d23dfedb DATACMNS-458 - Added PersistentEntities value object.
Introduced simple value object to hide a set of MappingContexts and be able to access PersistentEntities from them.
2014-03-02 08:39:32 +01:00
Oliver Gierke
4969b9094a DATACMNS-457 - MappingContext now provides information about managed types.
Added MappingContext.getManagedTypes() as well as ….hasPersistentEntity(Class) to access all types currently managed by the MappingContext and find out whether a type is managed by the context.
2014-03-01 12:37:23 +01:00
Oliver Gierke
4cee676608 DATACMNS-444 - DefaultPersistentPropertyPath now skips null converted names.
If a Converter handed into DefaultPersistentPropertyPath.toDotPath(…) returns null or an empty string for a mapped property name, that value is skipped during path construction.
2014-02-19 18:10:02 +01:00
Oliver Gierke
8f0979e963 DATACMNS-431 - Code cleanups. 2014-01-28 13:14:35 +01:00
Oliver Gierke
c0fc0f905a DATACMNS-401 - Some cleanups regarding generics and deprecations.
Suppress deprecation warnings for GenericTypeResolver for now. Added Simple(Property|Association)Handler to ease working with untyped PersistentProperty instances without having to fall back to raw types. Polished Sonargraph architecture description.
2013-11-14 09:28:11 +00:00
Oliver Gierke
fed61720b0 DATACMNS-400 - PersistentProperty now exposes findAnnotation(…).
Pulled up the method declaration from AnnotationBasedProperty as it's useful to be able to inspect a property for annotations being configured on it independently from whether the persistent mapping of it has been defined via annotations or not.

Expose isAnnotationPresent(…) as well to ease quick checks for an annotation.
2013-11-13 18:09:28 +00:00
Oliver Gierke
d26f90b281 DATACMNS-390 - Create defensive copy for persistent entities in AbstractMappingContext.
To prevent ConcurrentModificationExceptions when iterating over PersistentEntities while further entity types are potentially added to the MappingContext we now return a immutable defensive copy of the current entity set.
2013-11-04 11:03:49 +01:00
Oliver Gierke
ae9ee5b428 DATACMNS-387 - Improvements in null handling in PartTree area.
We're now rejecting invalid constructor arguments handed to ClassTypeInformation, Part, PartTree and PropertyPath. Beyond that we skip the creation of a Part for an empty path segment, so that you don't end up with an invalid Part instance for a findAllByOrderByFooAsc.
2013-10-27 16:34:26 +01:00
Oliver Gierke
1b3d9ed2c4 DATACMNS-380 - MappingContext.getPersistentPropertyPath(…) now throws MappingException. 2013-10-10 13:42:33 +02:00
Oliver Gierke
048394690f DATACMNS-381 - Improved exception message in PropertyReferenceException.
PropertyReferenceException now not only exposes the property not found but also the already resolved Property path to make it easier to understand what is causing the exception in the first place.
2013-10-10 13:01:09 +02:00
Oliver Gierke
06c2f41584 DATACMNS-380 - MappingContext exposes PersistentPropertyPath by dot path.
Introduced MappingContext.getPersistentPropertyPath(String, Class<?>) to allow looking up a PersistentPropertyPath from a plain dot-notated path expression (e.g. foo.bar.foobar). This removes the need to use a PropertyPath in case you really only want to look up plain path expressions and the additional functionality in PropertyPath (camel case traversal and interpreting _ as hard delimiter) is not needed or wanted.
2013-10-10 12:54:24 +02:00
Thomas Darimont
2afb570729 DATACMNS-345 - Use the actual type of the persistent property.
Changed getPersistentEntity(PersistentProperty<?>) to return the actual type of the persistent property in order to deal with collection and map types transparently.

Original pull request: #31.
2013-07-16 12:42:31 +02:00
Thomas Darimont
fc5ce662af DATACMNS-342 - Open up id property selection API in BasicPersistentEntity.
To support more advanced id property selection mechanisms we introduced a callback method returnPropertyIfBetterIdPropertyCandidate(…).

Pull request: #30.
2013-07-08 12:07:21 +02:00
Oliver Gierke
3a496b1f44 DATACMNS-337 - PersistentProperty now exposes getActualType().
The call transparently resolves map value types and collection component types if the property is either one of them.
2013-06-10 15:01:39 +02:00
Oliver Gierke
cd2ea03928 DATACMNS-332 - Further performance improvements.
Reverted from ConcurrentHashMap to plain HashMap where concurrency wasn't an issue and profiling showed performance hotspots. Introduced caches for ParameterizedTypeInformation.getComponentType() and the resolved raw type in TypeDiscoverer.
2013-05-23 18:57:48 +02:00
Oliver Gierke
905565cbcc DATACMNS-332 - Cache AnnotationBasedPersistentProperty.isTransient(). 2013-05-23 10:03:05 +02:00
Oliver Gierke
24bc432d48 DATACMNS-332 - AbstractMappingContext now prefers most concrete property.
BasicPersistentEntity now only caches the most concrete property for a by-name lookup to mimic the behavior that was implemented in getPersistentProperty(String name). This is to prevent shadowed properties of superclasses leaking into the by-name lookups.

Improved AbstractPersistentProperty.toString() to rather render the concrete field it is backed by.
2013-05-22 18:37:51 +02:00
Oliver Gierke
a9abb40fbd DATACMNS-332 - Performance improvements in conversion subsystem hotspots.
Added caching to DefaultTypeMapper, SimpleTypeInformationMapper, BasicPersistentEntity and PreferredConstructor as these seem to be performance hotspots on the reading side of object conversion.
2013-05-17 13:58:14 +02:00
Oliver Gierke
2c83144269 DATACMNS-327 - AbstractMappingContext implements InitializingBean again.
This causes the configured persistent entities being added to the context on its initialization instead of a delayed initialization on ApplicationContext refreshed event.
2013-05-12 23:45:11 +02:00
Oliver Gierke
0cf875b358 DATACMNS-320 - Be less restrictive in finding mapping ambiguities.
So far we threw exceptions in case we find the same exception on getters *and* setters. We now allow this scenario in case the annotations are semantically equivalent.
2013-04-25 15:13:42 +02:00
Oliver Gierke
e8b2db8463 DATACMNS-305 - Added toString() methods to PersistentProperty implementations. 2013-03-28 15:50:17 +01:00
Oliver Gierke
0aef8c60b7 DATACMNS-283 - MappingInstantiationException captures more context now.
If an exception occurs in ReflectionEntityInstantiator we now capture more context about the failed instantiation.
2013-02-15 18:34:56 +01:00
Oliver Gierke
0bbf0aec99 DATACMNS-282 - Improved caching in AnnotationBasedPersistentProperty.
AnnotationBasedPersistentProperty now caches direct annotations on construction but still tries to lookup an annotation as meta-annotation if not found in cache on later requests. Extended try/catch block in AbstractMappingContext.addPersistentEntity(…) to invalidate cache on exceptions during property creation as well.
2013-02-11 15:56:14 +01:00
Oliver Gierke
f18055a4c9 DATACMNS-274 - Fixed package cycle in mapping subsystem.
Updated Sonargraph architecture description along the way.
2013-01-29 10:50:50 +01:00
Oliver Gierke
33a31a25e0 DATACMNS-271 - AnnotationBasedPersistentProperty now caches annotation lookups. 2013-01-28 14:28:12 +01:00
Oliver Gierke
afb5ec2ef9 DATACMNS-269 - Add support for mapping annotations on accessor methods.
Mapping annotations are now looked up in the following order: getter, setter, field. Made mapping annotations usable on methods as well.
2013-01-16 17:29:51 +01:00
Oliver Gierke
ac256f9921 DATACMNS-266 - Use new common Maven build infrastructure.
Simplified project setup to be a single module build again. Using Spring Data Build parent POM to simplify project setup. See https://github.com/SpringSource/spring-data-build#spring-data-build-infrastructure
2013-01-16 15:15:24 +01:00