Commit Graph

179 Commits

Author SHA1 Message Date
Oliver Gierke
7126b11173 Formatting. 2011-09-01 18:15:09 +02:00
Phil Webb
112127d35f DATACMNS-69 - Updated cache key to bean name rather than class. 2011-09-01 14:47:12 +02:00
Oliver Gierke
1646f85a53 DATADOC-68 - Refactorings to support geo-near queries.
Removed dependency from Parameter to Parameters as it is obsolete. Let ClassUtils return component type for Iterables piped into getReturnedDomainClass(…).
2011-08-31 21:48:49 +02:00
Oliver Gierke
a32d80379b DATACMNS-69 - Added caching to RepositoryInterfaceAwareBeanPostProcessor.
Actual types resolved in getClassForPropertyValue(…) get cached now to avoid unnecessary attempt to load classes.
2011-08-31 21:22:47 +02:00
Oliver Gierke
c57d5246e3 DATACMNS-68 - Fixed potential NPE in AbstractPersistentProperty.
Fixed ClassTypeInformation returning correct component types for types implementing or extending a Collection or Map type.
2011-08-31 21:06:03 +02:00
Phillip Webb
0d83b27f62 DATACMNS-66 - Update shouldIgnoreCase to enum.
Change shouldIgnoreCase() to return an enum value allowing for exceptions to be thrown depending on when ignoreCase or allIgnoreCase is used.
2011-08-29 17:59:40 +02:00
Phillip Webb
f96dc0817a DATACMNS-66 - Polishing.
Removed Part.shouldAlwaysIgnoreCase() and don't constraint Part.shouldIgnoreCase() to String parts anymore.
2011-08-25 20:51:35 +02:00
Phil Webb
7ff8a43a75 DATACMNS-66 - Added support for IgnoreCase as query keyword.
The query parsing subsystem now supports using IgnoreCase when referencing String parameters, e.g.:

  findByUsernameIgnoreCase(String username);

Both 'IgnoreCase' and 'IgnoringCase' are supported. If you'd like to entirely ignore cases for all String property references add 'AllIgnoreCase' or 'AllIgnoringCase' to the query method.
2011-08-25 12:53:08 +02:00
Oliver Gierke
651a1f2db2 DATACMNS-67 - QueryMethod considers methods retuning Iterable collection queries. 2011-08-25 07:56:21 +02:00
Oliver Gierke
f13c53866c Polished UserCredentials value object. 2011-08-25 07:52:18 +02:00
Oliver Gierke
154794f91b DATACMNS-65 - Using ReentrantReadWriteLock to prevent race conditions in PersistentEntity creation.
We have to lock PersistentEntity creation as instances could be prematurely handed out and iteration over the properties might interfere new properties being added to the Set iterated over.
2011-08-23 20:12:54 +02:00
Oliver Gierke
e91e729098 DATACMNS-64 - QueryMethod now rejects paging methods without a Pageable argument.
Refactored ClassUtils.assertReturnType(…) to positively discover subtypes of the given types as well. Renamed the method accordingly.
2011-08-21 16:45:25 +02:00
Oliver Gierke
e21dd1d828 DATACMNS-63 - Added fromReturnTypeOf(…) to ClassTypeInformation. 2011-08-21 16:30:20 +02:00
Oliver Gierke
5cfd8bc3df DATACMNS-61 - Fixed Parameters lookup in QueryMethod. 2011-08-21 14:46:44 +02:00
Oliver Gierke
2b167566e1 DATACMNS-62 - Dropped QueryMethod.Type enum and made accessor methods for query type public. 2011-08-21 14:26:30 +02:00
Oliver Gierke
4074f2e387 DATACMNS-61 - Refactored QueryMethod, Parameters and Parameter to be more open for extension.
QueryMethod now provides a protected method to allow customization of the Parameters instance being used. Removed final modifier from Parameters and Parameter classes to allow extension. Refactored Parameter to be based on Spring's MethodParameter for more encapsulation. Added callback method to Parameters to allow customizing Parameter instance creation. Added protected method to ParametersParameterAccessor to get any parameter value by index.
2011-08-21 14:23:47 +02:00
Oliver Gierke
307993ac9b Fixed potential NullPointerExceptions for TypeDiscoverer.getComponentType() and getMapValueType(). 2011-08-19 22:44:13 +02:00
Oliver Gierke
c71f2684d3 Made properties of AbstractMappingContext final where possible. 2011-08-19 21:12:03 +02:00
Oliver Gierke
a330301b6a SimpleTypeHolder considers Object to be a simple type. 2011-08-19 21:11:24 +02:00
Oliver Gierke
40648c82a7 Formatting. 2011-08-16 17:47:12 +02:00
Oliver Gierke
1ee347cf40 DATACMNS-59 - AbstractQueryCreator now handles static and dynamic sorting combined.
Added and(…) method to Sort to combine two Sort instances and produce a resulting Sort.
2011-08-16 17:47:00 +02:00
Oliver Gierke
ba3cbe7244 DATACMNS-57 - TypeDiscoverer now discovers generic constructor parameters correctly.
Fixed formatting for unit test as well.
2011-07-28 17:46:57 +02:00
Oliver Gierke
30de1d55b7 DATACMNS-56 - Tweak to algorithm of PreferredConstructorDiscoverer to pick up single argument-taking constructor. 2011-07-25 23:38:18 +02:00
Oliver Gierke
2c538dbb15 DATACMNS-56 - PreferredConstructorDiscoverer does not throw an exception in case no preferred constructor is found. 2011-07-25 23:02:27 +02:00
Oliver Gierke
596a03c04c DATACMNS-55 - TypeDiscoverer now handles types extending Collections and Maps as well. 2011-07-25 22:59:14 +02:00
Oliver Gierke
abfe323e75 Removed unused import. 2011-07-19 17:34:31 +02:00
Oliver Gierke
751ca2ae22 DATAJPA-71 - Tweaked AbstractQueryCreator to be more flexible.
AbstractQueryCreator is now more lenient. We're now allowing instantiation without a ParameterAccessor for implementations that don't want to do parameter binding during query creation. We additionally provide a createQuery(Sort) now to allow handing in a dynamic Sort parameter taken from a query method to apply sorting even in case we don't bind parameters directly.

Added a method to Parameters to discover whether we potentially sort dynamically which simply tests for a Sort or Pageable parameter in the method signature.
2011-07-19 08:58:39 +02:00
Oliver Gierke
6e79fcbde0 Polished JavaDoc. 2011-07-15 10:09:35 +02:00
Oliver Gierke
954c74b788 DATACMNS-52 - Redeclared methods in intermediate repository interfaces are now discovered correctly.
We deeply have to resolve the generic types before doing the type comparison. Tweaked DefaultRepositoryInformation and added test cases.
2011-07-13 20:27:12 +02:00
Oliver Gierke
5a6427fdcf DATACMNS-50 - Added ability to define PersistentProperty order for PersistentEntities.
BasicPersistentEntity now has a constructor taking a Comparator and holds PersistentProperty instances in a TreeSet if a COmparator is given at construction. Removed getPersistentPropertyNames() from PersistentProperty interface as it's not used anywhere.
2011-07-06 18:04:52 +02:00
Oliver Gierke
7b3e61e050 DATACMNS-49 - Added infrastructure to read queries from a Properties file.
Added NamedQueries abstraction to hide a map of names to manually defined queries. Added PropertiesBasedNamedQueries to hold the named queries in a Properties instance. Extended resolveQuery(…) method in QueryLookupStrategy to take a NamedQuery instance to allow query creation callback use the named queries.

Added optional 'named-queries-location' attribute to the repositories namespace the bean definition parser loads the properties from to populate a PropertiesBasedNamedQueries instance and pipe it into the repository factory. Store implementations have to default the name to lookup in their RepositoryConfiguraion class (see CommonRepositoryConfigInformation.getNamedQueriesLocation()).
2011-06-23 19:05:49 +02:00
Oliver Gierke
dc50f489ba DATACMNS-48 - Renamed QueryExecuterMethodInterceptor to QueryExecutorMethodInterceptor. 2011-06-21 21:58:59 +02:00
Oliver Gierke
dcd4f0772c Exposing owner type for Property. 2011-06-17 19:41:37 +02:00
Oliver Gierke
6ddcad6998 Property instances can now be created from a dot notation as well.
Some JavaDoc polishing. Removed private method to lookup actual property type (read transparently resolving collection component and map value types) over TypeInformation.getActualType().
2011-06-17 19:41:37 +02:00
Oliver Gierke
3addb9c2f8 Added TypeInformation.getActualType().
The method transparently resolves the property type, collection component type or map value type depending on what the core type is.
2011-06-17 19:41:36 +02:00
Oliver Gierke
e86721fbdb Added MappingContext.getPersistentPropertyPath(…).
The method allows to get PersistentProperty instances for a given path expression.
2011-06-17 19:36:57 +02:00
Oliver Gierke
23dbfe27bb Added getType() method to Parameter value object. 2011-06-15 19:43:08 +02:00
Oliver Gierke
d2e46f6770 JavaDoc polishing. 2011-06-15 19:42:47 +02:00
Oliver Gierke
736b8adf08 Refactored package structure.
Resolved dependency cycles in repository and mapping packages. Introduced repository.core package as well as core.support where most of the type of former repository.support is in now. New repository.support only contains additional stuff built on top of core repository abstraction (e.g. Converters, PropertyEditors). Added some more unit tests to core mapping abstractions and removed not needed methods from its API.
2011-06-13 20:23:26 -07:00
Oliver Gierke
5650b068ed DATACMNS-31 - Added null check to SimpleTypeHolder.isSimpleType(…).
The MappingBeanHelper mentioned in the ticket was recently replaced by SimpleTypeHolder.
2011-06-10 15:03:08 -07:00
Oliver Gierke
7a13657eb5 DATACMNS-169 - Reworked simple type handling in mapping subsystem.
All simple type discovery is now done through a SimpletypeHolder instance that carries a few default types considered to be simple but is configurable to carry additional ones. The mapping subsystem uses an instance of that class to do simple type decisions and thus allows customizing what is to be considered a simple type by simply dependency injecting a value object.
2011-06-09 16:26:48 -07:00
Oliver Gierke
351e37e4eb DATACMNS-45 - Improved property handling in TypeDiscoverer and Property.
TypeDiscoverer now looks up property type using a PropertyDescriptor if no field with the given name can be found. Property now handles _-prefixed properties as well.
2011-06-07 15:49:26 -07:00
Oliver Gierke
3453806569 DATACMNS-44 - Fixed BindableParameterIterator.hasNext(). 2011-06-07 12:43:41 -07:00
Oliver Gierke
d5300ed1bc DATACMNS-43 - Corrected exception message in PreferredConstructorDiscoverer to mention PersistenceConstructor. 2011-06-07 11:50:28 -07:00
Oliver Gierke
364a84ffb8 DATACMNS-42 - MappingBeanHelper now considers all Numbers to be simple types.
Fixed bug in isSimpleType(…) along the lines.
2011-06-06 14:44:28 -07:00
Oliver Gierke
12d5c0ddb9 Polished JavaDoc. 2011-06-06 11:07:21 -07:00
Oliver Gierke
70da7b00f8 DATACMNS-41 - Refactored DefaultRepositoryInformation to take custom implementation class into account as well. 2011-06-01 00:29:52 +01:00
Oliver Gierke
399bc5e6bf Made DefaultRepositoryInformation public. 2011-05-31 22:34:59 +01:00
Oliver Gierke
0ea1921a96 Updated reference documentation regarding repository declaration.
Polished Javadoc of Repository to mention possibility of selectively exposing CRUD methods.
2011-05-24 12:33:18 +02:00
Oliver Gierke
dab13128f4 Introduced BeanWrapper helper object to reduce static access through MappingBeanHelper.
Creating bean instances, getting and setting properties on a bean was done by using static methods on MappingBeanHelper so far. This required certain Spring components (ConversionService) being held statically as well. Beyond that various Spring components had set these static values which might cause strange behavior if multiple instances of these Spring components are created. Thus we now have a BeanWrapper that takes the formerly statically held instances and uses those for bean creation and property access.

Moved SpEL awareness of a mapping into SpELAwareParameterValueProvider to hide it behind an ParameterValueProvider instance.
2011-05-24 12:31:59 +02:00