Skip to content

Commit e9498c8

Browse files
christophstroblmp911de
authored andcommitted
DATAMONGO-1705 - Deprecate cross-store support.
We deprecate cross-store support to remove cross-store with a future release. Original pull request: spring-projects#471.
1 parent 09f8dc6 commit e9498c8

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/DocumentBacked.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011 the original author or authors.
2+
* Copyright 2011-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,6 +17,12 @@
1717

1818
import org.springframework.data.crossstore.ChangeSetBacked;
1919

20+
/**
21+
* @author Thomas Risberg
22+
* @author Oliver Gierke
23+
* @deprecated will be removed without replacement.
24+
*/
25+
@Deprecated
2026
public interface DocumentBacked extends ChangeSetBacked {
2127

2228
}

spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoChangeSetPersister.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2016 the original author or authors.
2+
* Copyright 2011-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,7 +40,9 @@
4040
* @author Oliver Gierke
4141
* @author Alex Vengrovsk
4242
* @author Mark Paluch
43+
* @deprecated will be removed without replacement.
4344
*/
45+
@Deprecated
4446
public class MongoChangeSetPersister implements ChangeSetPersister<Object> {
4547

4648
private static final String ENTITY_CLASS = "_entity_class";

spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoDocumentBacking.aj

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011 the original author or authors.
2+
* Copyright 2011-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,7 +40,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
4040
* Aspect to turn an object annotated with @Document into a persistent document using Mongo.
4141
*
4242
* @author Thomas Risberg
43+
* @deprecated will be removed without replacement.
4344
*/
45+
@Deprecated
4446
public aspect MongoDocumentBacking {
4547

4648
private static final Logger LOGGER = LoggerFactory.getLogger(MongoDocumentBacking.class);

spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/RelatedDocument.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011 the original author or authors.
2+
* Copyright 2011-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,9 @@
2222

2323
/**
2424
* @author Thomas Risberg
25+
* @deprecated will be removed without replacement.
2526
*/
27+
@Deprecated
2628
@Retention(RetentionPolicy.RUNTIME)
2729
@Target({ ElementType.FIELD })
2830
public @interface RelatedDocument {

src/main/asciidoc/reference/cross-store.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[[mongo.cross.store]]
22
= Cross Store support
33

4+
WARNING: Deprecated - will be removed without replacement.
5+
46
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.
57

68
[[mongodb_cross-store-configuration]]

src/main/asciidoc/reference/mongodb.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The MongoDB support contains a wide range of features which are summarized below
1212
* Java based Query, Criteria, and Update DSLs
1313
* Automatic implementation of Repository interfaces including support for custom finder methods.
1414
* QueryDSL integration to support type-safe queries.
15-
* Cross-store persistence - support for JPA Entities with fields transparently persisted/retrieved using MongoDB
15+
* Cross-store persistence - support for JPA Entities with fields transparently persisted/retrieved using MongoDB (deprecated - will be removed without replacement)
1616
* GeoSpatial integration
1717

1818
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.

0 commit comments

Comments
 (0)