DATACOUCH-539 - Deprecate annotations before GA

This changeset also brings back deleted annotations so that they
do not cause build issues in other components.
This commit is contained in:
Michael Nitschinger
2020-05-11 15:05:53 +02:00
parent 4e229448f2
commit 33fdffab2f
5 changed files with 149 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ import org.springframework.data.annotation.QueryAnnotation;
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
@QueryAnnotation
@Deprecated
public @interface Dimensional {
/** The name of the design document to be queried */
String designDocument();

View File

@@ -0,0 +1,36 @@
/*
* Copyright 2012-2020 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.couchbase.core.query;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.data.couchbase.repository.CouchbaseRepository;
/**
* This annotation is targeted at {@link CouchbaseRepository Repository} interfaces, indicating that the framework
* should ensure a N1QL Primary Index is present on the repository's associated bucket when the repository is created.
*
* @author Simon Baslé
*/
@Deprecated
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface N1qlPrimaryIndexed {
}

View File

@@ -0,0 +1,47 @@
/*
* Copyright 2012-2020 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.couchbase.core.query;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.data.couchbase.repository.CouchbaseRepository;
/**
* This annotation is targeted at {@link CouchbaseRepository Repository} interfaces, indicating that the framework
* should ensure a N1QL Secondary Index is present when the repository is instantiated.
* <p/>
* Said index will relate to the "type" field (the one bearing type information) and restrict on documents that match
* the repository's entity class.
* <p/>
* Be sure to also use {@link N1qlPrimaryIndexed} to make sure the PRIMARY INDEX is there as well.
*
* @author Simon Baslé
*/
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Deprecated
public @interface N1qlSecondaryIndexed {
/**
* the name of the index to be created, in the repository's associated bucket namespace.
*/
String indexName();
}

View File

@@ -33,6 +33,7 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
// don't set @QueryAnnotation, as it causes problems with reduce and replacing count() method, the reduce detection
// needs to be improved
@Deprecated
public @interface View {
/**

View File

@@ -0,0 +1,64 @@
/*
* Copyright 2012-2020 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.couchbase.core.query;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.data.couchbase.repository.CouchbaseRepository;
/**
* This annotation is targeted at {@link CouchbaseRepository Repository} interfaces, indicating that the framework
* should ensure a View is present when the repository is instantiated.
* <p/>
* The view must at least be described as a design document name and view name. Default map function will filter
* documents on the type associated to the repository, and default reduce function is "_count".
* <p/>
* One can specify a custom reduce function as well as a non-default map function.
*
* @author Simon Baslé
*/
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Deprecated
public @interface ViewIndexed {
/**
* The design document in which to create/look for the view. Usually to create the backing view for CRUD methods, the
* expected designDoc value is the entity's simple class name, with a lowercase first letter (eg. a UserInfo
* repository would expect a design document named "userInfo").
*/
String designDoc();
/**
* The name of the view, defaults to "all" (which is what CRUD methods expect by default).
*/
String viewName() default "all";
/**
* The map function to use (default is empty, which will trigger a default map function filtering on the repository's
* associated entity type).
*/
String mapFunction() default "";
/**
* The reduce function to use (default is built in "_count" reduce function).
*/
String reduceFunction() default "_count";
}