Commit Graph

486 Commits

Author SHA1 Message Date
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
Oliver Gierke
c908d0e023 DATACMNS-265 - Polished JavaDoc. 2013-01-11 11:35:02 +01:00
Oliver Gierke
68ef3c68b0 DATACMNS-263 - Fixed incompatibility with OpenWebbeans < 1.1.8.
Prefer using non-anonymous inner classes to represent @Default and @Any qualifiers. Upgraded to OpenWebbeans 1.1.7 along the way.
2013-01-05 19:31:42 +01:00
Oliver Gierke
c289428fe5 DATACMNS-260 - Extracted SpelExpressionParameterValueProvider.
Extracted SpelExpressionParameterValueProvider from PersistentEntityParameterValueProvider to allow extension to recursively map the value resolved from the SpEL expression evaluation. This extension has to override the potentiallyConvertSpelValue(…) method to continue nested conversion.
2012-12-16 15:09:00 +01:00
Oliver Gierke
0c4ed8a86a DATACMNS-257 - PropertyPath can now handle all-uppercase fields.
So far, PropertyPath inevitably uncapitalized the property names it was created for. We now check, whether the source name is all uppercase and prevent uncapitalization in this case.
2012-11-29 12:22:30 +01:00
Oliver Gierke
d0111d8118 DATACMNS-256 - Exposing getPersistentEntity() on Repositories.
Extended RepositoryFactoryInformation to expose the PersistentEntity for the domain type the repository factory is eventually creating the repository for. The default implementation in RepositoryFactoryBeanSupport exposes a protected setMappingContext(…) that is later used to lookup the PersistentEntity.
2012-11-28 17:18:55 +01:00
Oliver Gierke
d5e0517517 DATACMNS-255 - Made TypeFilterParser public.
Moved it into common config package. Changed visibility to public. Polished JavaDoc now that it's available to public consumption.
2012-11-28 15:41:42 +01:00
Oliver Gierke
7712fe1563 DATACMNS-254 - Polished JavaDoc of Auditable. 2012-11-27 15:10:31 +01:00
Oliver Gierke
a05a6d5e77 DATACMNS-253 - Improved exception message in ParameterOutOfBoundsException. 2012-11-27 13:39:36 +01:00
Oliver Gierke
70639d0d4b DATACMNS-137 - Added configuration support for AuditingHandlers.
Added attribute group to namespace XSD to define common attributes used to set up an AuditingHandler. Added BeanDefinitionParser that will create a BeanDefinition for an AuditingHandler based on these properties. Store-specific namespace implementations can use that to simplify the configuration setup. Added an IsNewAwareAuditingHandlerBeanDefinitionParser to do the same for an IsNewAwareAuditingHandler.
2012-11-26 18:15:42 +01:00
Oliver Gierke
cc1561d92c DATACMNS-251 - Introduced generic abstraction to determine "is new" state of entities.
Introduced IsNewStrategy and IsNewStrategyFactory interfaces to allow abstracting the way the is-new state of an entity can be determined. The factory allows creating a strategy instance by inspected type, whereas the actual strategy then implements the is-new decision based on a given entity.

We provide a MappingContext based factory implementation that looks up a PersistentEntity for the type requested and inspects it for an @Version or @Id property. It will then return strategy implementations that inspect the detected properties and check their values against null or 0 respectively. We also add a CachingIsNewStrategyFactory wrapper to prevent the lookup of the actual strategy from being done over and over again.

The @Version annotation was pulled up from the Spring Data MongoDB module. It can be used as meta annotation to allow a deprecation step on the MongoDB's @Version one.

Added an IsNewAwareAuditingHandler that exposes a unifying markAudited(…) delegating to the markCreated(…) and markModified(…) depending on the outcome of the IsNewStrategy.
2012-11-26 18:14:38 +01:00
Oliver Gierke
8a01a55046 DATACMNS-227 - Renamed repository resource populator location attribute to locations.
Tightened test cases to check correct population more strictly. Upgraded to Hamcrest 1.3 as test dependency on the way.
2012-11-23 15:06:42 +01:00
Oliver Gierke
f1fd8fe0e2 DATACMNS-137, DATAJPA-116 - Added support for annotation based auditing.
Introduced annotations CreatedBy, CreatedDate, LastModifiedBy and LastModifiedDate to allow demarcating fields as auditing related ones. The date related annotations require a field type of either DateTime, Date, Long or a primitive long. All these annotations can be used as meta-annotations.

Extracted an AuditingHandler from Spring Data JPA which allows to transparently set auditing information on objects implementing Auditable or use the newly introduced annotations in a store independent manner. This allows other stores to implement adapters to provide auditing support as well.

Introduced a more convenient way of finding fields in ReflectionUtils using the FieldFilters of core Spring. The API allows to select fields based on a filter and can transparently check that only one field matches the given filter if desired.
2012-11-20 17:25:16 +01:00
Oliver Gierke
2042bda8a2 DATACMNS-248 - Moved to Slf4j API for logging. 2012-11-19 23:30:14 +01:00
Oliver Gierke
c0e45a4a3b DATACMNS-247 - Improved implementation of RepositoryBeanDefinitionRegistrarSupport.
RepositoryBeanDefinitionRegistrarSupport not implements BeanClassLoaderAware and ResourceLoaderAware as Spring 3.2 will regard these callback interfaces and inject the resources. We still default these injected resources upon invocation to be able to run on Spring 3.1 as well.
2012-11-13 15:06:54 +01:00
Oliver Gierke
874da365ed DATACMNS-168 - Allow customizing repository bean names.
The bean name is now resolved through inspecting Spring stereotype annotations and @Named on the repository interface. If none found we're still using the uncapitalized simple interface name as we did until now.
2012-11-12 14:28:13 +01:00
Spring Buildmaster
075e31d917 DATACMNS-192 - Prepare next development iteration. 2012-10-09 05:31:15 -07:00
Spring Buildmaster
18c1392e96 DATACMNS-192 - Release version 1.4.0.RELEASE. 2012-10-09 05:31:11 -07:00
Oliver Gierke
14815dca3a DATACMNS-192 - Updated changelog for 1.4.0.RELEASE. 2012-10-09 14:24:11 +02:00
Oliver Gierke
3498af528a DATACMNS-242 - Improved exception messages in QueryMethod. 2012-10-09 14:05:34 +02:00
Oliver Gierke
e675e14082 DATACMNS-241 - Upgraded to Spring HATEOAS 0.3.0.RELEASE. 2012-10-09 14:05:17 +02:00
Oliver Gierke
75026cdb1d DATACMNS-239 - Fixed event handling in AbstractResourcePopulatorFactoryBean.
Switched from implementing ApplicationEventPublisherAware to ApplicationContextAware to get a reference to an ApplicationContext to fix comparison of the event source.
2012-10-09 10:59:08 +02:00
Oliver Gierke
861cf40419 DATACMNS-240 - Upgraded to Querydsl 2.8.0. 2012-10-08 14:46:31 +02:00
Oliver Gierke
5ed34bc2ce DATACMNS-235 - Enforce dependency ordering for custom repository implementations. 2012-09-18 11:40:26 +02:00
Oliver Gierke
8344387738 DATAJPA-251 - Updated reference documentation.
Improved code samples for PageableArgumentResolver. Corrected registration info for DomainClassConverter and added JavaConfig example. Replace all obsolete readAll(…) method samples with findAll(…). Added hint to @PageableDefaults now being aware of sort properties and direction.
2012-09-17 16:26:25 +02:00
Oliver Gierke
c8c26baf7c DATACMNS-230 - Clarify packages of Page and Sort in reference docs.
Fully qualified first mentions of Pageable and Sort to avoid ambiguities with types of potentially available types of the same name in a store specific implementation.
2012-09-17 11:24:46 +02:00
Oliver Gierke
936facac88 DATACMNS-146 - PageableDefaults now takes sorting info as well.
PageableDefaults now has a sort and sortDir attribute to allow defining the default sorting options applied to the pageable.
2012-09-17 10:48:32 +02:00
Oliver Gierke
9b4cbb48f1 DATACMNS-233 - DomainClassConverter is now safe against null and empty Strings.
Added explicit check for null or empty String source before attempting conversion. Returning null for both cases.
2012-09-17 10:23:43 +02:00
Oliver Gierke
51d45f34c3 DATACMNS-229 - RepositoryInterfaceAwareBeanPostProcessor now uses bean class loader. 2012-09-13 20:00:53 +02:00
Oliver Gierke
346de533bc DATACMNS-231 - Polished Sort domain class.
Improved/fixed JavaDoc. Made orders property final. Fixed formatting here and there. Deprecated Order.create(…) factory method as new Sort(…) can be used instead.
2012-09-13 19:26:43 +02:00
Oliver Gierke
96bc596333 DATACMNS-176 - ClassTypeInformation now always inspects user class.
Unwrap potentially wrapped CBGlib classes handed to ClassTypeInformation for inspection.
2012-09-13 19:21:10 +02:00
Oliver Gierke
a01de83547 DATACMNS-228 - AbstractMappingContext disregards Groovy meta fields.
Refactored persistent field discovery by extracting the FieldFilter implementation and improving the way excluded fields are detected. We now exclude all fields named "this$*" as well as a metaClass field of type groovy.lang.MetaClass explicitly.
2012-09-10 12:56:20 +02:00
Oliver Gierke
e922845407 DATACMNS-220, DATAJPA-174 - Updated reference docs on query parsing.
Updated the repositories reference documentation section on query parsing to reflect the correct usage of method prefixes, how to use the Distinct, IgnoreCase and OrderBy clauses.
2012-09-04 11:05:55 +02:00
Oliver Gierke
bd6c0bf7c6 DATACMNS-224 - RepositoryPopulator now throws event after population.
The ResourceReaderRepositoryPopulator now throws an RepositoriesPopulatedEvent after the population was finished. This indicates the data provided through the resources having been inserted into the database and the repository setup (including population) being completed.
2012-09-04 10:28:06 +02:00
Oliver Gierke
8604de5597 DATACMNS-223 - Added logging to ResourceReaderRepositoryPopulator.
Logging the read resources in INFO level, the individual elements persisted in DEBUG. Polished JavaDoc.
2012-09-04 10:02:32 +02:00
Oliver Gierke
5c54e7fef1 DATACMNS-222 - Fixed JavaDoc of AbstractRepositoryPopulator. 2012-09-04 09:51:37 +02:00
Aleksander Blomskøld
f0ffd0316c DATACMNS-221 - Added support for Unicode characters in PartTree.
Altered parsing regular expressions to support unicode characters.
2012-09-04 09:08:11 +02:00
Oliver Gierke
4939fbf3bc DATACMNS-226 - Fixed bug in ConfigurableTypeInformationMapper caching.
Separated ConfigurableTypeInformationMapper from MappingContextTypeInformationMapper. The latter now lazily picks up the alias information if the cached values do not contain aliases.

Polished JavaDocs and clarified meaning of null values.
2012-09-03 13:36:34 +02:00
Oliver Gierke
d0e0c8cf5f DATACMNS-225 - Updated Querydsl Maven plugin to 1.0.4. 2012-09-03 13:14:56 +02:00
Spring Buildmaster
ed7beffbde DATACMNS-217 - Prepare next development iteration. 2012-08-23 10:25:19 -07:00
Spring Buildmaster
11da3c3dab DATACMNS-217 - Release version 1.4.0.RC1. 2012-08-23 10:25:15 -07:00
Oliver Gierke
7cb77eb1db DATACMNS-217 - Updated changelog for 1.4.0.RC1. 2012-08-23 19:18:28 +02:00
Oliver Gierke
566a9cdd1e DATACMNS-217 - Update Spring Hateoas dependency to 0.2.0.RELEASE. 2012-08-23 18:55:20 +02:00
Oliver Gierke
6d2d22954f DATACMNS-218 - Expose RevisionMetadata from Revision. 2012-08-23 18:51:50 +02:00
Oliver Gierke
b570c57df5 DATACMNS-219 - Make Spring 3.1.2.RELEASE default Spring dependency version.
We move away from Maven version ranges as they complicate the build and dependency resolution process. They make the build in-reproducible. Users stuck with a 3.0.x version of Spring will now have to manually declare Spring dependencies in their needed 3.0.x version. Not that at least Spring 3.0.7 is required currently.
2012-08-20 16:47:51 +02:00
Oliver Gierke
307e003902 DATACMNS-214 - Simple types are not considered PersistentEntities anymore.
Before actually adding a type as PersistentEntity, AbstractMappingContext will call shouldCreatePersistentEntityFor(TypeInformation<?> type) now. The default implementation will just consider the SimpleTypeHolder for that decision. However as adding a Converter to the context will render the converted object to be treated as simple, one might want to override this method to be more precise and only rule out store-specific simple types at this stage.
2012-08-16 12:55:07 +02:00
Oliver Gierke
0fc753f151 DATACMNS-211 - Fixed component type resolving for arrays.
ClassTypeInformation does not resolve nested array types anymore as a multidimensional array in fact has a component type of an array of one dimension less, e.g. String[][].getComponentType() -> String[].
2012-08-16 12:52:25 +02:00
Oliver Gierke
c6b04618b9 DATACMNS-216 - Removed deprecations from AbstractMappingContext.
Removed the deprecation as it might still be necessary to set the ApplicationEventPublisher to emit MappingContextEvents.
2012-08-16 12:52:24 +02:00
Oliver Gierke
d9e5d92a16 DATACMNS-207 - Removed getPropertyDescriptor() from PersistentProperty. 2012-08-16 12:52:24 +02:00