From e9498c86ca74bdc698ae20b83f11fb6872b1db24 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Wed, 21 Jun 2017 10:52:13 +0200 Subject: [PATCH] DATAMONGO-1705 - Deprecate cross-store support. We deprecate cross-store support to remove cross-store with a future release. Original pull request: #471. --- .../data/mongodb/crossstore/DocumentBacked.java | 8 +++++++- .../data/mongodb/crossstore/MongoChangeSetPersister.java | 4 +++- .../data/mongodb/crossstore/MongoDocumentBacking.aj | 4 +++- .../data/mongodb/crossstore/RelatedDocument.java | 4 +++- src/main/asciidoc/reference/cross-store.adoc | 2 ++ src/main/asciidoc/reference/mongodb.adoc | 2 +- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/DocumentBacked.java b/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/DocumentBacked.java index db044c4a3..876a1e1d9 100644 --- a/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/DocumentBacked.java +++ b/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/DocumentBacked.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,12 @@ package org.springframework.data.mongodb.crossstore; import org.springframework.data.crossstore.ChangeSetBacked; +/** + * @author Thomas Risberg + * @author Oliver Gierke + * @deprecated will be removed without replacement. + */ +@Deprecated public interface DocumentBacked extends ChangeSetBacked { } diff --git a/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoChangeSetPersister.java b/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoChangeSetPersister.java index d9a262512..15e9db80b 100644 --- a/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoChangeSetPersister.java +++ b/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoChangeSetPersister.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2016 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,9 @@ import com.mongodb.client.result.DeleteResult; * @author Oliver Gierke * @author Alex Vengrovsk * @author Mark Paluch + * @deprecated will be removed without replacement. */ +@Deprecated public class MongoChangeSetPersister implements ChangeSetPersister { private static final String ENTITY_CLASS = "_entity_class"; diff --git a/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoDocumentBacking.aj b/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoDocumentBacking.aj index 1a0a101c6..a032194c4 100644 --- a/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoDocumentBacking.aj +++ b/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoDocumentBacking.aj @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager * Aspect to turn an object annotated with @Document into a persistent document using Mongo. * * @author Thomas Risberg + * @deprecated will be removed without replacement. */ +@Deprecated public aspect MongoDocumentBacking { private static final Logger LOGGER = LoggerFactory.getLogger(MongoDocumentBacking.class); diff --git a/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/RelatedDocument.java b/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/RelatedDocument.java index 33ff2a2bf..0fdcef417 100644 --- a/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/RelatedDocument.java +++ b/spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/RelatedDocument.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,9 @@ import java.lang.annotation.Target; /** * @author Thomas Risberg + * @deprecated will be removed without replacement. */ +@Deprecated @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.FIELD }) public @interface RelatedDocument { diff --git a/src/main/asciidoc/reference/cross-store.adoc b/src/main/asciidoc/reference/cross-store.adoc index 94dc4ca57..763837d62 100644 --- a/src/main/asciidoc/reference/cross-store.adoc +++ b/src/main/asciidoc/reference/cross-store.adoc @@ -1,6 +1,8 @@ [[mongo.cross.store]] = Cross Store support +WARNING: Deprecated - will be removed without replacement. + Sometimes you need to store data in multiple data stores and these data stores can be of different types. One might be relational while the other a document store. For this use case we have created a separate module in the MongoDB support that handles what we call cross-store support. The current implementation is based on JPA as the driver for the relational database and we allow select fields in the Entities to be stored in a Mongo database. In addition to allowing you to store your data in two stores we also coordinate persistence operations for the non-transactional MongoDB store with the transaction life-cycle for the relational database. [[mongodb_cross-store-configuration]] diff --git a/src/main/asciidoc/reference/mongodb.adoc b/src/main/asciidoc/reference/mongodb.adoc index 0b08a03fe..32d10acf4 100644 --- a/src/main/asciidoc/reference/mongodb.adoc +++ b/src/main/asciidoc/reference/mongodb.adoc @@ -12,7 +12,7 @@ The MongoDB support contains a wide range of features which are summarized below * Java based Query, Criteria, and Update DSLs * Automatic implementation of Repository interfaces including support for custom finder methods. * QueryDSL integration to support type-safe queries. -* Cross-store persistence - support for JPA Entities with fields transparently persisted/retrieved using MongoDB +* Cross-store persistence - support for JPA Entities with fields transparently persisted/retrieved using MongoDB (deprecated - will be removed without replacement) * GeoSpatial integration For most tasks you will find yourself using `MongoTemplate` or the Repository support that both leverage the rich mapping functionality. `MongoTemplate` is the place to look for accessing functionality such as incrementing counters or ad-hoc CRUD operations. `MongoTemplate` also provides callback methods so that it is easy for you to get a hold of the low level API artifacts such as `com.mongo.DB` to communicate directly with MongoDB. The goal with naming conventions on various API artifacts is to copy those in the base MongoDB Java driver so you can easily map your existing knowledge onto the Spring APIs.