Skip to content

Commit

Permalink
Do not scan Persistent annotated classes. (#1180)
Browse files Browse the repository at this point in the history
Only scan Document annotated classes.

Closes #1121.
  • Loading branch information
mikereiche committed Aug 13, 2021
1 parent 3e51707 commit 351370b
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -27,7 +27,6 @@
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.data.annotation.Persistent;
import org.springframework.data.convert.CustomConversions;
import org.springframework.data.couchbase.CouchbaseClientFactory;
import org.springframework.data.couchbase.SimpleCouchbaseClientFactory;
Expand Down Expand Up @@ -68,6 +67,7 @@
* @author Stephane Nicoll
* @author Subhashni Balakrishnan
* @author Jorge Rodriguez Martin
* @author Michael Reiche
*/
@Configuration
public abstract class AbstractCouchbaseConfiguration {
Expand Down Expand Up @@ -230,7 +230,6 @@ protected Set<Class<?>> getInitialEntitySet() throws ClassNotFoundException {
ClassPathScanningCandidateComponentProvider componentProvider = new ClassPathScanningCandidateComponentProvider(
false);
componentProvider.addIncludeFilter(new AnnotationTypeFilter(Document.class));
componentProvider.addIncludeFilter(new AnnotationTypeFilter(Persistent.class));
for (BeanDefinition candidate : componentProvider.findCandidateComponents(basePackage)) {
initialEntitySet.add(
ClassUtils.forName(candidate.getBeanClassName(), AbstractCouchbaseConfiguration.class.getClassLoader()));
Expand Down

0 comments on commit 351370b

Please sign in to comment.