Commit Graph

21 Commits

Author SHA1 Message Date
Oliver Gierke
fd4121e03e DATACMNS-511 - Improve equals(…) and hashCode() in TypeVariableTypeInformation.
The equals(…) and hashCode() methods of TypeVariableTypeInformation previously tried to evaluate the unresolved context of the type variable. This can cause issues in recursive type definitions as set up in the according test case. We now implement the methods based on the resolved type to makes sure we break the recursive lookup of PersistentEntity instances in AbstractMappingContext. 

The erroneous lookup was actually caused by unresolved base types being added to the mapping context within the JPA project as the JPA meta-model also returns those types as managed types.

Related pull request: #84.
2014-05-28 15:40:21 +02:00
Oliver Gierke
5791e9b201 DATACMNS-495 - Prepare 1.8.0.RC1.
Removed compiler warnings (obsolete @SuppressWarnings and obsolete code). Upgraded to Spring HATEOAS 0.11.0.
2014-05-01 20:23:58 +02:00
Christoph Strobl
57271baf54 DATACMNS-496 - Version.parse(…) now drops non-numeric artifacts.
Version parsing failed when given version contained non-numeric parts (like 2.0.0-rc1). We now strip everything after the first non numeric part to create a logical version equivalent of the source String.

Original pull request: #81.
2014-04-29 16:02:10 +02:00
Oliver Gierke
165c0595e3 DATACMNS-485 - API improvements to in TypeInformationMapper area.
The default implementations of the TypeInformation Mapper interfaces now work with ClassTypeInformation where possible to express they only map raw types effectively.

Added TypeInformation.getRawTypeInformation() to easily turn whatever TypeInformation into the raw type representation. Changed ClassTypeInformation.from(…) to return ClassTypeInformations directly.
2014-04-15 07:49:46 +02:00
Oliver Gierke
e13fc294bb DATACMNS-486 - Added ParsingUtils helper class to easily transform camel case Strings.
Refactored XmlRepositoryConfigurationSource to use the newly introduced type.
2014-04-10 18:35:36 +02:00
Oliver Gierke
f52635da13 DATACMNS-485 - Fixed bug in ParameterizedTypeInformation.hashCode().
Previously, ParameterizedTypeInformation.hashCode() had been inconsistent to equals in case of a fully resolved parameterized type. This is now fixed by not including the parent reference in case a parameterized type is resolved completely.

Also, TypeDiscoverer.getActualType() does not return the component type for non-collection/non-maps anymore to make sure we don't accidentally unwrap parameterized types.
2014-04-02 09:59:44 +02:00
Oliver Gierke
08d5f936c8 DATACMNS-452 - Added constructor to DirectFieldAccessFallbackBeanWrapper. 2014-03-06 19:27:53 +01:00
Oliver Gierke
6408e16faf DATACMNS-452 - Added some helper types to simplify the implementations in store modules.
Added AnnotatedTypeScanner to easily scan for annotated types within a set of base packages. Picks up interfaces by default which had to be customized when using ClassPathScanningCanidateComponentProvider.

Added DirectFieldAccessFallbackBeanWrapper that will use direct field access for beans in case no accessor method can be found. This allows to easily implement bean property values through accessors first but using the field directly if the accessors aren't available.

Introduced AnnotationDetectionMethodCallback to easily find methods equipped with a given annotation.
2014-02-27 08:36:00 +01:00
Oliver Gierke
ab37869a1a DATACMNS-446 - Added toString() methods to TypeInformation types. 2014-02-23 13:51:41 +01:00
Oliver Gierke
931a697ec5 DATACMNS-440 - Fixed map value type resolving for Map value types.
Previously the map value type resolving algorithm checked the value type to be of type Map again to shortcut the resolution. We now weakened this to an assignment check and eagerly resolve the generic type if its bound on exactly that level already. If no concrete type argument can be found, we fall back to the general generics resolution mechanism.
2014-02-13 12:06:26 +01:00
Oliver Gierke
1f172725f0 DATACMNS-422 - Mitigate semantic changes in Spring 4.0's GenericTypeResolver.
In case of an unresolvable generic parameter in TypeDiscoverer's getTypeArgument(…) we check for a generic super type for the given bound and fall back to Object in case we find a parameterized type.
2014-01-19 15:37:44 +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
057c2e9bf8 DATACMNS-384 - Polished toString() representation of Version.
Trailing zeros now get removed up until the minor version number.
2013-11-04 11:02:50 +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
06df973c54 DATACMNS-384 - Introduced value object for Version. 2013-10-17 10:29:33 +02:00
Oliver Gierke
541ef648f1 DATACMNS-356 - Parameters now uses DefaultParameterNameDiscoverer if present.
We now leniently try to lookup DefaultParameterNameDiscoverer and create an instance of it to make use of Spring 4's improved parameter name capabilities on Java 8. We fall back on a LocalVariableTableParameterNameDiscoverer if on Spring versions prior to 4.
2013-08-07 14:39:37 +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
8d69459f74 DATACMNS-311 - TypeDiscoverer now also finds properties in type hierarchy.
We now also inspect the entire type hierarchy to lookup a property descriptor to inspect for read methods in case no field is found for a property.
2013-04-12 16:41:39 +02:00
Oliver Gierke
a7820c8cc6 DATACMNS-309 - Fixed lookup of nested properties on TypeDiscoverer.
So far the property lookup of a nested property path (e.g. "foo.bar") failed in cases the head property was not cached already. We now recursively resolve the type information even for an unpopulated cache.
2013-04-05 20:44:27 +02:00
Oliver Gierke
6b49eb4ca5 DATACMNS-276 - Added hashCode() to ParameterizedTypeInformation.
Implemented hashCode() to be as close as possible to the equals(…) implementation.
2013-01-29 13:07:44 +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