Skip to content

Commit 33fdffa

Browse files
committed
DATACOUCH-539 - Deprecate annotations before GA
This changeset also brings back deleted annotations so that they do not cause build issues in other components.
1 parent 4e22944 commit 33fdffa

File tree

5 files changed

+149
-0
lines changed

5 files changed

+149
-0
lines changed

src/main/java/org/springframework/data/couchbase/core/query/Dimensional.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
@Retention(RetentionPolicy.RUNTIME)
3434
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
3535
@QueryAnnotation
36+
@Deprecated
3637
public @interface Dimensional {
3738
/** The name of the design document to be queried */
3839
String designDocument();
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2012-2020 the original author or authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.data.couchbase.core.query;
18+
19+
import java.lang.annotation.ElementType;
20+
import java.lang.annotation.Retention;
21+
import java.lang.annotation.RetentionPolicy;
22+
import java.lang.annotation.Target;
23+
24+
import org.springframework.data.couchbase.repository.CouchbaseRepository;
25+
26+
/**
27+
* This annotation is targeted at {@link CouchbaseRepository Repository} interfaces, indicating that the framework
28+
* should ensure a N1QL Primary Index is present on the repository's associated bucket when the repository is created.
29+
*
30+
* @author Simon Baslé
31+
*/
32+
@Deprecated
33+
@Target({ElementType.TYPE})
34+
@Retention(RetentionPolicy.RUNTIME)
35+
public @interface N1qlPrimaryIndexed {
36+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2012-2020 the original author or authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.data.couchbase.core.query;
18+
19+
import java.lang.annotation.ElementType;
20+
import java.lang.annotation.Retention;
21+
import java.lang.annotation.RetentionPolicy;
22+
import java.lang.annotation.Target;
23+
24+
import org.springframework.data.couchbase.repository.CouchbaseRepository;
25+
26+
/**
27+
* This annotation is targeted at {@link CouchbaseRepository Repository} interfaces, indicating that the framework
28+
* should ensure a N1QL Secondary Index is present when the repository is instantiated.
29+
* <p/>
30+
* Said index will relate to the "type" field (the one bearing type information) and restrict on documents that match
31+
* the repository's entity class.
32+
* <p/>
33+
* Be sure to also use {@link N1qlPrimaryIndexed} to make sure the PRIMARY INDEX is there as well.
34+
*
35+
* @author Simon Baslé
36+
*/
37+
@Target({ ElementType.TYPE })
38+
@Retention(RetentionPolicy.RUNTIME)
39+
@Deprecated
40+
public @interface N1qlSecondaryIndexed {
41+
42+
/**
43+
* the name of the index to be created, in the repository's associated bucket namespace.
44+
*/
45+
String indexName();
46+
47+
}

src/main/java/org/springframework/data/couchbase/core/query/View.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
@Retention(RetentionPolicy.RUNTIME)
3434
// don't set @QueryAnnotation, as it causes problems with reduce and replacing count() method, the reduce detection
3535
// needs to be improved
36+
@Deprecated
3637
public @interface View {
3738

3839
/**
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright 2012-2020 the original author or authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.data.couchbase.core.query;
18+
19+
import java.lang.annotation.ElementType;
20+
import java.lang.annotation.Retention;
21+
import java.lang.annotation.RetentionPolicy;
22+
import java.lang.annotation.Target;
23+
24+
import org.springframework.data.couchbase.repository.CouchbaseRepository;
25+
26+
/**
27+
* This annotation is targeted at {@link CouchbaseRepository Repository} interfaces, indicating that the framework
28+
* should ensure a View is present when the repository is instantiated.
29+
* <p/>
30+
* The view must at least be described as a design document name and view name. Default map function will filter
31+
* documents on the type associated to the repository, and default reduce function is "_count".
32+
* <p/>
33+
* One can specify a custom reduce function as well as a non-default map function.
34+
*
35+
* @author Simon Baslé
36+
*/
37+
@Target({ ElementType.TYPE })
38+
@Retention(RetentionPolicy.RUNTIME)
39+
@Deprecated
40+
public @interface ViewIndexed {
41+
42+
/**
43+
* The design document in which to create/look for the view. Usually to create the backing view for CRUD methods, the
44+
* expected designDoc value is the entity's simple class name, with a lowercase first letter (eg. a UserInfo
45+
* repository would expect a design document named "userInfo").
46+
*/
47+
String designDoc();
48+
49+
/**
50+
* The name of the view, defaults to "all" (which is what CRUD methods expect by default).
51+
*/
52+
String viewName() default "all";
53+
54+
/**
55+
* The map function to use (default is empty, which will trigger a default map function filtering on the repository's
56+
* associated entity type).
57+
*/
58+
String mapFunction() default "";
59+
60+
/**
61+
* The reduce function to use (default is built in "_count" reduce function).
62+
*/
63+
String reduceFunction() default "_count";
64+
}

0 commit comments

Comments
 (0)