Commit Graph

670 Commits

Author SHA1 Message Date
Thomas Risberg
9b86637031 DATADOC-119 added support for registering custom converters with the mongo namespace support 2011-05-11 15:00:59 -04:00
Oliver Gierke
d7f33774e0 DATACMNS-35 - Added implementation and test for newly introduced Repository.delete(ID id) method. 2011-05-11 18:37:59 +02:00
Oliver Gierke
12ddfcc9f9 DATADOC-128 - Enable storing inheritance trees.
The document being persisted now gets a _class attribute to carry the actual type. That field key will be made configurable by a subsequent commit and its value should be interpreted as type hint to a client and  might be interpreted using a type mapper at a later stage as well (see DATADOC-63). For now it carries the fully-qualified Java class name.

On reads MappingMongoConverter will consider this field when choosing a type to bind the data to if - and only if - the type stored in there is a subtype of the actually requested one. So if we have a document carrying Person type information and you query for Contact you would get back a Person object. If you query for any other type not extending Contact you would get this custom type instead.

Added unit tests and an integration tests covering the Contact/Person scenario.
2011-05-10 18:21:47 +02:00
Oliver Gierke
47f184dbf0 Fixed generic warning by using more concrete meta-model type. 2011-05-10 18:16:05 +02:00
Oliver Gierke
2ca10c13c5 Extracted custom mongo repository namespace attributes to make them usable in <repositories /> and <repository />. 2011-05-10 18:14:06 +02:00
Oliver Gierke
965f9fd260 DATACMNS-34 - Adapted refactorings in Spring Data Commons regarding PersistenceConstructor discovery. 2011-05-10 10:20:06 +02:00
Thomas Risberg
d5c625dc2a DATADOC-107 added an overloaded method taking a Collection; added test to only allow a single parameter of type Collection 2011-05-09 08:54:39 -04:00
Oliver Gierke
55ce0b8272 DATADOC-130 - Conversion of Maps with simple key types works again.
Don't use ConversionService for simple type keys as we unregistered ObjectToStringConverter. This in turn causes Number, Boolean, Locale and the like not being convertible to String anymore as for those types only the Type -> String converter is registered but no corresponding converter back. Opened a ticket for this against Core Spring (SPR-8306).
2011-05-07 19:27:48 +02:00
Oliver Gierke
1c8a55a081 DATADOC-113 - NotNull and IsNull are now working for repositories.
Fixed Criteria being able to create correct query for ….is(null). MongoQueryCreator now uses ….ne(…) instead of ….not().is(…) as this doesn't generate a correct query (see DATADOC-129).
2011-05-07 15:53:45 +02:00
Oliver Gierke
35259f4e12 Reapplied old formatting to avoid merge conflicts (yet again). 2011-05-07 15:50:15 +02:00
Thomas Risberg
c9facf5338 DATADOC-129 changed Criteria to disallow 'not' before 'is' - should use 'ne' instead 2011-05-06 12:00:35 -04:00
Thomas Risberg
283e5cb76b DATADOC-118 refactoring some of the protected methods; some other minor refactorings 2011-05-05 18:12:56 -04:00
J. Brisbin
f05d200cd3 Fix the build since a new change for DATADOC-114 caused some tests to not compile cleanly. 2011-05-05 15:14:43 -05:00
J. Brisbin
62ecfc8416 DATADOC-114 - Fixes for updateFirst/updateMulti not converting POJOs correctly 2011-05-05 15:09:28 -05:00
Thomas Risberg
dfbc89c3b6 DATADOC-118 removed methods that take a MongoWriter 2011-05-05 13:59:29 -04:00
Thomas Risberg
b6c6016b1e DATADOC-120 removed MongoReaderWriter interface 2011-05-05 13:46:07 -04:00
Thomas Risberg
c9fe785c32 DATADOC-118 removed methods that take a MongoReader 2011-05-05 13:45:43 -04:00
Oliver Gierke
7b3d030794 DATADOC-43 - Implemented Near and Within for repository queries.
Refactored spatial domain classes to use each other a bit more. Added assertions to fail fast on invalid usage. Improved Geospatial index creation in MongoPersistentEntityIndexCreator by using the index abstraction instead of manually building the DBObject.

Fixed implementation of SimpleMongoRepository.deleteAll() to not drop the collection as this causes indexes to be dropped as well.

Skip index creation from query methods for now if we encounter a Near or Within part as we can't build combined queries right now.
2011-05-05 14:30:07 +02:00
Oliver Gierke
02448bc0ee Reverted formatting change in Criteria for now. 2011-05-05 14:21:08 +02:00
Thomas Risberg
e4fdabba1d DATADOC-117 removed defaultCollection on MongoTemplate/Operations; changed getDefaultCollectionName to getCollectionName(Class clazz) to determine collection name used for specific class; added a class parameter where necessary 2011-05-04 18:34:15 -04:00
Thomas Risberg
0c9ee0eacd DATADOC-106 added support for $ne and $nor 2011-05-03 07:54:59 -04:00
Oliver Gierke
7f6a6094e6 DATADOC-115 - Upgraded to Querydsl 2.2.0-beta4.
Enabled treatment of not annotated classes as embedded documents to let Querydsl create query classes for them. Annotated BasePerson with @QuerySupertype as Querydsl seems to need this annotation to create the query class for super types in the 2.2 branch.

That issue is tracked in https://bugs.launchpad.net/querydsl/+bug/776219 so that we should be able to remove the annotation as soon as this one is fixed.
2011-05-03 11:51:28 +02:00
Jon Brisbin
68f8bd62d1 DATADOC-114 - Fix bug in Update class that wasn't converting POJOs properly when being used from updateFirst/Multi 2011-05-02 13:04:10 -05:00
Thomas Risberg
caa8faf769 DATADOC-102 modified Update to allow multiple field updates for most operations 2011-04-30 17:39:55 -04:00
Thomas Risberg
6e4e487eb4 added collection name to logging messages 2011-04-30 10:48:28 -04:00
Thomas Risberg
d065bd74b3 DATADOC-96 added additional or test 2011-04-28 16:28:01 -04:00
Oliver Gierke
d648c95b62 Removed accidentally commited files. 2011-04-28 21:44:43 +02:00
Oliver Gierke
ef2b0235c7 DATADOC-109 - Introduced MappingContext implementation for SimpleMongoConverter.
Adapted changes in Spring Data Commons. Adapted test cases accordingly. Introduced SimpleMongoMappingContext that that reflects the meta-model assumptions in SimpleMongoConverter. Adapted repository factories accordingly as we can now assume that there is a MappingContext available always.

Refactored QueryMapper to be stateless so that we don't need to recreate instances of it. Added unit tests to verify id property to key mapping and type conversion to ObjectId.

Polished MappingTests to simply drop the database after all test were finished to make sure it starts with a clean state on a potential next run.
2011-04-28 21:35:19 +02:00
Jon Brisbin
321948d4a2 DATADOC-97 - Fix a couple bugs in the QueryMapper class. 2011-04-27 11:26:20 -05:00
Jon Brisbin
21f859e222 DATADOC-97 - Fixed an NPE in the QueryMapper class. 2011-04-27 11:17:06 -05:00
Jon Brisbin
224934a28c DATADOC-97 - Took out extraneous methods from MongoTemplate as the result of incorporating a new QueryMapper class. 2011-04-27 11:13:09 -05:00
J. Brisbin
a74d9ca7cd Merge branch 'query-mapper' 2011-04-27 11:07:35 -05:00
Jon Brisbin
76159a2216 DATADOC-97 - Added a QueryMapper helper to map properties referenced in query criteria to their proper name (_id in the case of @Id properties) as well as support conversion to ObjectId for those values that support the conversion. 2011-04-27 11:04:39 -05:00
Oliver Gierke
9c9138c4e9 DATADOC-101 - Improved custom converter handling.
Converters are now considered for both reading and writing. I also added a shortcut to invoke custom converters for top level types. So far the registered ones had only be used for properties of the given root object, not the root object itself.
2011-04-27 14:54:53 +02:00
Jon Brisbin
7567ba0355 DATADOC-95 - Fix issue where an object will all null properties wasn't being saved. 2011-04-27 07:52:01 -05:00
Thomas Risberg
dc36d91d8e DATADOC-94 added plugin repository info for maven.springframework.org/release to resolve aws wagon extension 2011-04-25 16:42:20 -04:00
Mark Pollack
f0b30ec39e DATADOC-99 - Reference documentation shows invalid field spec for @Query usage with repositories 2011-04-25 14:01:32 -04:00
Mark Pollack
178b220d2d expand on test to test retrieval of subelements. add-remove spring .xsd in STS to remove tooling releated error 2011-04-25 14:01:31 -04:00
Oliver Gierke
fe74557c95 DATACMNS-33 - Adapted API changes for Repository.count().
Also changed return types for count() methods on QueryDslPredicateExecutor.
2011-04-21 10:02:59 +02:00
Oliver Gierke
399beff795 DATACMNS-32 - Removed Querydsl support classes and use the ones from Spring Data Commons Core. 2011-04-20 20:37:06 +02:00
J. Brisbin
9380a88f26 Fix for problem loading domain classes with DBRef on them. 2011-04-19 14:01:57 -05:00
J. Brisbin
5e4583110e Took out unused variable 2011-04-19 13:13:09 -05:00
J. Brisbin
8a3296758d DATADOC-98 - Fixes for multi-dimensional arrays and lists as properties. 2011-04-19 12:50:50 -05:00
Thomas Risberg
60ba9bfcc2 updated to 1.1.0.BUILD-SNAPSHOT for data-commons 2011-04-19 11:26:52 -04:00
Thomas Risberg
db75aca336 fixed highlight xls 2011-04-19 11:24:55 -04:00
Oliver Gierke
36d62e12fc Added Mongo annotation package to the supported annotation types. 2011-04-19 16:28:27 +02:00
Oliver Gierke
f9b1fb57cd Added Spring Release repository as plugin repository to find AspectJ 1.6.11.RELEASE. 2011-04-19 16:28:27 +02:00
Mark Pollack
3ab2aeb5c1 add mvn repo information 2011-04-11 14:10:04 -04:00
Thomas Risberg
99e96958ed preparing for snapshot builds 2011-04-09 19:11:26 -04:00
Thomas Risberg
20c9af6550 updated changelog with latest release info 2011-04-09 19:02:44 -04:00