Commit Graph

1719 Commits

Author SHA1 Message Date
Jon Brisbin
027a67dd1b Reorganized how index creation and initial entity registration are handled. It now happens when the context is refreshed and any time entities are registered with addPersistentEntity via synchronous ApplicationEvent dispatching. 2011-03-22 13:54:26 -05:00
Jon Brisbin
84aba45895 Put addPersistentEntity calls into a dedicated ApplicationEvent listener bean that gets populated by the classpath scanning done in the namespace parser. 2011-03-22 11:16:35 -05:00
Jon Brisbin
537e2e71c4 Fix for bug in handling arrays, deleted extraneous test class. 2011-03-21 12:02:05 -05:00
Jon Brisbin
a1ef9abef2 Fixes for handling Arrays, had to change index creation from event-based to synchronous for simplicity's sake. 2011-03-21 11:41:32 -05:00
Oliver Gierke
d01867b072 Fixed broken test.
Removed wiring a MongoTemplate as constructor argument for MongoMappingConfigurationBuilder.
2011-03-21 16:49:22 +01:00
Jon Brisbin
07188d2a27 Fixed namespace handler support, added a MappingContextEvent listener for (asynchronously) creating indexes whenever entities are registered with the mapper. Removed that part of the code from the MongoMappingConfigurationBuilder, which means it no longer has that dependency on MongoTemplate. Also tweaked some afterPropertiesSet methods to try and reduce the problem of chicken-and-egg dependencies within mapping components. 2011-03-18 09:56:18 -05:00
Oliver Gierke
5df34cec70 @SuppressedWarning cleanups. 2011-03-18 07:59:49 +01:00
Oliver Gierke
bea1ed9cbe Ignore MappingTests in the meantime to get the build working. 2011-03-18 07:59:36 +01:00
Oliver Gierke
f41e60a264 Prefer considering the value type over the property type at the decision whether to recursively map an object or simply write it as plain value.
Removed obsolete code (probably introduced by invalidly resolving a merge conflict).
2011-03-17 23:04:28 +01:00
Oliver Gierke
d69b890a70 DATADOC-40 - Repositories now pick up collection name from mapping metadata if available.
We also pick up the ID attribute to be used to determine isNew(…) if the RepositoryFactoryBean gets a MappingContext injected. Collection name of mapping defaults to the simple class name.
2011-03-17 23:02:51 +01:00
Jon Brisbin
d215004f92 Added a namespacehandler and broke all the tests. :) 2011-03-17 15:23:45 -05:00
Mark Pollack
c4fdc54ffe Merge remote branch 'origin/master' 2011-03-17 15:36:39 -04:00
Mark Pollack
cb2cd48ca1 Ignore Thumbs.db 2011-03-17 15:36:30 -04:00
Jon Brisbin
f0c4f3e75f Drop back to using LinkedBlockingQueue because the Deque version is Java 6.0 2011-03-17 13:09:03 -05:00
Jon Brisbin
6540c23413 Added event handling capabilities based on Spring 2.0 ApplicationEvent abstractions. Publishes events into the current ApplicationContext to expose internal mapping events to listeners declared in the current ApplicationContext. 2011-03-17 11:57:07 -05:00
Oliver Gierke
49e3f2b8c7 Improved handling of custom converters.
On COnverter registration we now keep track of the types the converter can register and only apply custom conversion if we had discovered a custom converter initially.
2011-03-17 14:34:36 +01:00
Oliver Gierke
30e4c4330b Tweaks after merging Jon's latest changes. 2011-03-17 10:31:08 +01:00
Oliver Gierke
c4701d18f6 Tweaked unit test to use mock ApplicationContext. 2011-03-17 10:12:50 +01:00
Oliver Gierke
4629ebdcfe Tweaked MappingMongoConverter to prefer custom Converters.
Before recursively converting values itself, MappingMongoConverter now checks whether the underlying ConversionService can convert the value to be converted into a Mongo basic type itself.
2011-03-17 10:12:49 +01:00
Oliver Gierke
611793d5c7 Improved handling of custom converters in SimpleMongoConverter.
Explicitly remove converter for Object -> String on instance creation which allows us to get rid of the ugly SimpleToStringSuppressingGenericConversionService. writeCompoundValue(…) now asks the ConversionService whether it can convert the value to be written into one of Mongos native primitive types and rather delegates to the service instead of recursively writing the value itself.
2011-03-17 10:10:57 +01:00
Jon Brisbin
74df4349ed Use DBRefs instead of DBObjects so that save() will work. Now requires that a Mongo instance be set on the MappingMongoConverter, which is done from afterPropertiesSet() on the template. 2011-03-16 08:48:25 -05:00
Oliver Gierke
b6c3760e78 Fixed ConversionService handling in SimpleMongoConverter.
Removed possibility to use custom ConversionService and rather provide a setter to allow registering custom Converter and ConverterFactory instances. This way we can use a custom ConversionService our own that does not regard the ObjectToStringConverter registered by default. This way ConversionService.canConvert(…, String.class) will not return true by default.
2011-03-16 11:56:39 +01:00
Oliver Gierke
f747f3df60 Only consider properties that are backed by a field actually.
Changed MongoPropertyDescriptor.isMappable(…) to check whether the owning type actually has a field with the property name. If not the property will not be regarded as mappable. This results in plain functional getters (that are not a bean property getter actually) to be skipped transparently.
2011-03-16 11:56:39 +01:00
Thomas Risberg
4b7d96347c ignore the eclipse project files 2011-03-15 23:36:20 -04:00
Thomas Risberg
d223a9817a added test scope 2011-03-15 23:36:20 -04:00
Mark Pollack
fed97a3134 Add setter for WriteResutlChecking and MongoConverter 2011-03-15 17:01:19 -04:00
Oliver Gierke
0492b189af Added some @SuppressWarnings where necessary. 2011-03-15 20:39:03 +01:00
Oliver Gierke
8b16502b2a Re-added dependency to Mongo driver. 2011-03-15 20:06:16 +01:00
Oliver Gierke
673c70b7de DATADOC-41 - Initial version of QueryDsl integration for Mongo DB.
Added necessary dependencies, repository and APT processor plugin. Added QueryDslPredicateExecutor and a QueryDsl specific sub-class of SimpleMongoRepository.
Adapted MongoRepositoryFactory to use new QueryDslRepository implementation when a repository interface extends QueryDslPredicateExecutor. Added AnnotationProcessor to create query classes from QueryDsl annotations.

Todo's left open:

- move common QueryDsl integration code into Spring Data commons (see TODOs in the sourcecode)
2011-03-15 18:36:19 +01:00
Thomas Risberg
e3bee8ab0e restored missing dependencies 2011-03-15 13:20:47 -04:00
J. Brisbin
032de81478 Format, organize imports, remove eclipse artifacts 2011-03-15 11:57:55 -05:00
Oliver Gierke
d4f358abd0 Adapted introduction of TypeInformation in Spring Data Commons Core.
The MappingMongoConverter now uses TypeInformation to inspect field types and nested ones. Created overloaded versions of read(…) and write(…) to work with PersistentEntity directly so that nested calls to those methods can be distinguished from from top level ones.
2011-03-15 17:29:18 +01:00
J. Brisbin
408294c93f Merging into master 2011-03-15 09:05:59 -05:00
Jon Brisbin
65d7a7feaf Preparing to merge into branch master 2011-03-15 09:01:29 -05:00
J. Brisbin
784ee634b6 Merge branch 'master' of github.com:SpringSource/spring-data-document into spring-data-mapping 2011-03-15 08:58:46 -05:00
Oliver Gierke
f2119ed235 Added Spring Milestone plugin repository to find AspectJ. 2011-03-15 08:45:08 +01:00
Mark Pollack
e9957ea718 remove reference to src/main/resoures as eclipse was complianing 2011-03-14 12:33:21 -04:00
Jon Brisbin
21048f211d Tweaks to tests, BasePerson class, common inheritance to test classes, tweaks to complex/simple type detection. 2011-03-14 10:58:36 -05:00
J. Brisbin
255fbb3379 Merge branches 'master' and 'spring-data-mapping' of github.com:SpringSource/spring-data-document into spring-data-mapping 2011-03-14 08:28:30 -05:00
Oliver Gierke
47b8523cb3 Removed Mongo specific id handling from ConfigurationBuilder.
Introduced MongoPersistentProperty that implements handling of fields with certain types and names as id property.
2011-03-13 09:12:52 +01:00
J. Brisbin
d92c7e2ff5 Merge branch 'spring-data-mapping' of github.com:SpringSource/spring-data-document into spring-data-mapping 2011-03-12 20:09:21 -06:00
J. Brisbin
c365830b2c Fixes for bug skipping fields in superclasses 2011-03-12 20:03:23 -06:00
Oliver Gierke
2947bfeaa6 Removed @Override annotations as they cannot be used at interfaces with Java 5. 2011-03-12 08:36:42 +01:00
Oliver Gierke
01a800b2cc DATACMNS-20 - Adapted refactoring of Repository.findById(…) to findOne(…). 2011-03-12 08:23:32 +01:00
Oliver Gierke
4daab96bc4 DATAJPA-19 - Adapted generics and metadata changes made in core. 2011-03-12 08:23:32 +01:00
J. Brisbin
e66f95bcf8 spring-data-commons object mapping support for MongoDB 2011-03-11 16:39:39 -06:00
Oliver Gierke
d824ed7e72 DATACMNS-21 - Override Repository methods returning Iterable.
As the MongoOperations currently only returns Lists anyway we can override the methods returning an Iterable to return List for now.
2011-03-11 19:01:05 +01:00
Oliver Gierke
f585beffc8 DATACMNS-20 - Adapted refactoring of Repository.findById(…) to findOne(…). 2011-03-11 18:19:45 +01:00
Oliver Gierke
68635687d1 DATAJPA-19 - Adapted generics and metadata changes made in core. 2011-03-11 16:41:34 +01:00
Thomas Risberg
60f9b05760 DATADOC-48 added additional tests for cross-store 2011-03-09 16:29:12 -05:00