Commit Graph

1550 Commits

Author SHA1 Message Date
Thomas Risberg
7d948e28f3 added skip() 2011-02-03 16:19:56 -05:00
Thomas Risberg
d4ebb9a01c added skip also 2011-02-03 16:15:21 -05:00
Thomas Risberg
9e5eb96150 first part of MongoTemplate/Query refactoring 2011-02-03 16:02:11 -05:00
Oliver Gierke
f9e50916e1 Refactored repository implementation to use QuerySpec API.
Use QuerySpec instead of QueryBuilder now. Refactored query method query building to populate CriteriaSpec and work with root QuerySpec object until the API is polished. Some test should break right now as we have to get the skip and sorting stuff into the API.
2011-02-03 18:46:01 +00:00
Thomas Risberg
4ed5ff7dc8 created Sort as separate construct 2011-02-03 11:57:45 -05:00
Oliver Gierke
3ecad1cfd2 DATADOC-30 - Improvements to reference documentation.
Included core repository documentation from Spring Data Commons. Polished documents and restructured them a little.
2011-02-03 15:04:20 +00:00
Thomas Risberg
e2146bf997 renamed query methods to find; changed query methods taking JSON to accept the new Query object instead; added support for fields specification; removed write concern methods for collection and DB; 2011-02-02 17:54:52 -05:00
Thomas Risberg
d5b1b06a79 updated to Spring 3.0.5 2011-02-02 13:49:20 -05:00
Thomas Risberg
b362d559cb added QuerySpec and associated support classes; refactored UpdateSpec to implement Update interface 2011-02-02 12:51:01 -05:00
Thomas Risberg
0b2a3fae1d renamed UpdateBuilder to UpdateSpec and moved to builder package 2011-02-02 12:11:41 -05:00
Thomas Risberg
325e356bb8 DATADOC-14 added WriteConcern for MongoTemplate to be used for write operations when specified and also methods to set WriteConcern for DB and Collections 2011-01-26 13:06:52 -05:00
Oliver Gierke
29e770a9f7 DATACMNS-12 - Adapted namespace XSD to latest changes Spring Data Commons.
Added necessary attribute groups.
2011-01-26 17:53:53 +02:00
Thomas Risberg
2cd7b74264 added getter/setter for ExceptionTranslator 2011-01-25 12:04:55 -05:00
Thomas Risberg
a1c6c8d671 added ExceptionTranslator inreface to factory bean for convenience during configuration and to be consistent with JPA configs 2011-01-25 12:03:24 -05:00
Thomas Risberg
1daf3059ba fixed bug for handling the case of non-generated keys on inserts 2011-01-25 12:01:38 -05:00
Thomas Risberg
96badc7a9e made the utils class public again 2011-01-17 10:35:27 -05:00
Mark Pollack
d86175fcd3 DATADOC-21 - Create namespace to configure Mongo root object 2011-01-07 17:32:53 -05:00
Oliver Gierke
9cb0b69aa1 Adapted newly introduced Property model.
Added integration tests for traversing nested properties. Added query logging at debug level.
2011-01-07 22:30:11 +01:00
Oliver Gierke
9152ca89da Added support for non-primitive-value-referencing queries.
Query methods can now query for related objects of an entity. Test cases are centered around a Person having an Address. The query is something like:

List<Person> findByAddress(Address address);

We correctly marshal the parameter into a DBObject using the MongoConverter on argument binding.

Exposed the configured MongoConverter at MongoTemplate so that the repository infrastructure gets access to it. Let repository classes work with the template again instead of plain MongoOperations. Removed find(…) method from MongoOperations and -Template. Extended SimpleMongoConverter so that it can unmarshal collections as well.
2011-01-07 16:44:49 +01:00
Oliver Gierke
5796611b8f Simplified MongoPropertyDescriptor.isOfIdType(). 2011-01-05 20:19:43 +01:00
Oliver Gierke
cb6bed43ab Improvements to repositories.
- MongoRepositoryFactory now validates id type for supported types
- use MongoOperations.find(…) in SimpleMongoRepository.findById(…)
- added integration test for findById(…)
- added integration test for MongoTemplate
2011-01-05 20:01:40 +01:00
Oliver Gierke
8abd7df7ef Improvements to SimpleMongoConverter and MongoTemplate.
- improved signature of MongoReader to return an object of the type handed to it
- added convertObjectId(ObjectId id, Class targetType) to MongoConverter to delegate id conversion to the converter as well
- changed return values of some internal methods from Object to ObjectId where generally nothing else can come out of
- refactored populateIdIfNecessary(…) in MongoTemplate to use MongoConverter to convert the ObjectId created by the insert or save operation
- use field access where possible to avoid the need for setters
- introduced value objects MongoBeanWrapper and MongoPropertyDescriptor to simplify the code
- unpopulated id fields will get populated on marshaling
- support String, ObjectId and BigInteger as id types
- added find(…) method to MongoTemplate that looks up objects by type and id
2011-01-05 19:57:07 +01:00
Oliver Gierke
b49f285de5 Improvements to JavaDoc of MongoReader interface.
- clarified restrictions to the implementation
2011-01-04 19:49:54 +01:00
Oliver Gierke
67cb890644 Renamed DBHolder to DbHolder and reduced its scope to package visibility. 2011-01-04 19:49:54 +01:00
Oliver Gierke
fe68229fbd Renamed DBCallback to DbCallback. 2011-01-04 19:49:50 +01:00
Oliver Gierke
fb442d34e1 Updated copyright notice to reach into 2011 as well. 2011-01-04 19:42:36 +01:00
Oliver Gierke
affbe71f93 DATADOC-4 - Improved MongoTemplate exception handling
- moved exception translation from MongoDbUtils to MongoExceptionTranslator
- don't let MongoFactoryBean implement PersistenceExceptionTranslator
- heavily refactored MongoTemplate to let higher level methods use callbacks to centralize exception handling in the callback executing methods
- changed return type of MongoOperations.getCollectionNames to Set<String> as returning a List implies same order, that we can't guarantee actually
- polished JavaDoc of MongoOperations
- added assertions to methods
- changed methods taking a List<Object> to take a List<? extends Object> instead
- added abstract unit test for MongoOperations to define tests regarding expected exception behavior
- let MongoTemplateUnitTests extend MongoOperationsUnitTests
2011-01-04 19:42:00 +01:00
Oliver Gierke
47dde8ab4d Minor FindBugs polishing.
- removed obsolete property in MongoTemplate
- removed obsolete Exception declaration in MongoOoptionsFactoryBean
- use HashMap instead of LinkedHashMap as property in UpdateBuilder
- renamed local variable in MongoEntityinformation not to shadow a field
- reduced visibility of MongoSynchronization and fixed generics
- reduced visibility of MongoDbUtils and make it an abstract non-instantiateable class
- eliminate nested if-clause in MongoDbUtils
- removed obsolete class FluentDbObject
- added serialVersionUID to CannotGetMongoDbConnectionException
- created static inner enum for ObjectId-to-String converter
- added generics to Portfolio test entity
- polished SimpleMongoConverterTests and MvcAnalyticsTest
- removed some unnecessary imports and modifiers
2011-01-04 12:34:15 +01:00
Oliver Gierke
b88ce28709 Polished MongoTemplate
- default converter to SimpleMongoConverter in constructor already
- made potential final members final
- use error message template instead of repeating the same String over and over again
- removed _-prefix from id variables
- extracted "_id" to ID constant
- fixed inevitable NullPointerExceptions in updateFirst(…), updateMulti(…) and remove(…)
- remove special handling of non available username and password in getDb() as MongoDbUtils.getDB already handles them correctly
- removed throws Exception form afterPropertiesSet() as it does not throw any checked exception
- use String as type for passwords at MongoTemplate API and only turn it into the underlying char[] when handing it to MongoDbUtils
- added assertions for mandatory constructor arguments
2011-01-04 11:17:02 +01:00
Oliver Gierke
70059760bb DATADOC-30 - Fixed typo in InvalidDocumentStoreApiUsageException. 2011-01-02 14:22:55 +01:00
Oliver Gierke
f61a306f80 Corrected generics in MongoRepository. 2011-01-02 14:19:22 +01:00
Oliver Gierke
b975546b55 Use Pageable.getOffset() instead of calculating it. 2010-12-29 18:05:31 +01:00
Oliver Gierke
9b8137790b Fixed some Findbugs issues.
Adapted to method renaming in Spring Data Commons.
2010-12-29 15:31:35 +01:00
Oliver Gierke
e9a8f39e4f Added package-info.java files for repository packages. 2010-12-29 14:43:43 +01:00
Oliver Gierke
04df1bdc66 Adapt changes to repository factory from Commons project. 2010-12-29 14:11:26 +01:00
Mark Pollack
47438367f6 Merge remote branch 'origin/master' 2010-12-23 14:47:46 -05:00
Mark Pollack
e4d44e4a17 Add javadocs. 2010-12-23 14:46:13 -05:00
Thomas Risberg
80b245001a DATADOC-30 updated configuration examples 2010-12-23 13:05:54 -05:00
Thomas Risberg
a7127bb312 cleanup 2010-12-21 16:52:50 -05:00
Oliver Gierke
6a8a8eaf2b DATADOC-30 - Added repository specific documentation.
Added sample for setup and usage as well as samples for query methods and a table of currently supported keywords, samples and the according Mongo query expressions.
2010-12-21 14:04:54 +01:00
Thomas Risberg
6816ec8508 added getCollectionNames method 2010-12-17 16:28:39 -05:00
Thomas Risberg
930e711ea5 DATADOC-30 copied base docs from key-value -- thanks Costin 2010-12-17 16:21:14 -05:00
Oliver Gierke
9b81171305 Code polishing. 2010-12-17 20:02:56 +01:00
Oliver Gierke
3d4f33d93c DATADOC-31 - Added 'Between' keyword support for query parser.
Updated test sample entity and repository accordingly.
2010-12-17 00:20:06 +01:00
Thomas Risberg
d28ee80efb fixed missing empty options for createCollection 2010-12-16 14:49:03 -05:00
Oliver Gierke
95ac7e638c DATADOC-18 - Let Repository subsystem use MongoOperations instead of MongoTemplate. 2010-12-16 13:05:50 +01:00
Thomas Risberg
95e5f703b5 DATADOC-1 addded tests for enums 2010-12-15 18:00:05 -05:00
Thomas Risberg
b24e004377 updated classpath 2010-12-15 17:59:18 -05:00
Thomas Risberg
5f78e01aa3 DATADOC-18 extracted common MongoTemplate methods into MongoOperations interface 2010-12-15 12:37:56 -05:00
Thomas Risberg
8479de82a7 DATADOC-1 addded support for List and arrays 2010-12-15 12:37:56 -05:00